| The existence of external defects directly affects the quality of the fruit,reduces the value of its affiliated commodities,reduces consumers’ desire for consumption,and indirectly causes losses in all aspects of the fruit industry.In order to solve this problem,it is necessary to detect the external defects of the fruits,eliminate the fruits with external defects,and improve the quality of fruits.When testing the external quality of fruits,if manual evaluation is used,it will be affected by the experience level of the testing personnel,and its subjectivity is too large,making the testing results uneven and difficult to form a standard.Therefore,it is important and practical to realize the automatic detection of the external defects of the fruit.This paper takes Korla fragrant pear as the research object,and conducts research on the online detection of its external defects.The research is carried out based on the embedded machine vision system,and the algorithm of fragrant pear defect recognition and classification is researched.In the research process,it is necessary to build an embedded machine vision research platform,based on this platform to collect Korla fragrant pear images,and use image processing technology to study how to automatically identify and classify the external defects of Korla fragrant pears.The external defects of fragrant pears studied in this paper are mainly fruit rust,disease,insect bites,scars and mechanical damage.The main contents of the study are as follows:(1)Build an embedded machine vision research platform: select and design the hardware and software of the embedded machine vision system,use STM32f103ZET6 as the main control and processing core of the system,choose the CMOS camera OV7725 as the image acquisition module,and transplant Free RTOS as the real-time operating system for efficient use Processor resources,other software and hardware are selected and designed with them as the core.(2)Segmentation of fragrant pear contour and defect area: use the difference between fragrant pear area and background area,and the difference of pixel gray value between defective area and fragrant pear area to segment the background,fragrant pear contour and defect area of fragrant pear image.In the segmentation process,grayscale,image enhancement,threshold segmentation,edge extraction,and morphological processing are used in the image processing technology to reduce the redundant information in the image and highlight the features to be extracted,which will be the future research Provide better conditions.(3)Defect feature value selection: In the research,14 feature parameters in the geometric feature,color feature and texture feature extracted from the defect were researched and analyzed.According to the comparison result,the circularity,S component,gray average value and energy were selected.As a feature parameter,combined with the decision tree to construct the fragrant pear defect recognition and classification algorithm.During the research process,it was discovered that the algorithm for detecting whether fragrant pears have fruit stems based on morphological processing and the algorithm for identifying deformed pears based on roundness features,the recognition accuracy rates were 90% and 88%,respectively.(4)The performance test of the researched defect classification and recognition algorithm and the embedded machine vision system shows that the accuracy of the recognition and classification of external defects of Korla fragrant pear is 90.5%,which shows that this article is based on low-power and low-cost embedded machines The visual system research on the online detection of external defects of Korla fragrant pear has practical significance. |