Abstract:Apple’s typical quality detection experiment was conducted on visual detection platform and the development environment Halcon in this paper. After image acquisition and processing the region of interest was extracted to find out the specific area containing the apple. Moreover, its contour was extracted using dynamic threshold segmentation method, and the area of this contour was calculated and used to assess the size of the apple. Furthermore, the typical defect fruit rot was detected using threshold segmentation method, and then the different gray values were shown in different colors. Based on different region’s colors, the defects were detected based on the colors of different regions, and the color feature was valued using RGB color model and template matching method. A good region was selected to create a template and set parameters, and then the appropriate threshold was set as a qualified color according to the standard color of the R component. In this study, the extraction and the area of the fruit contour were calculated, and the defect and color detections of apples were realized. Finally, good results in the size, defect and color detections of apples were achieved by using Halcon and machine vision methods.