Abstract:In order to realize the automatic colour and lustre recognition of "seedless white" raisins in Turpan, Xinjiang, in this paper, OpenCV open source function library was used as an image processing tool, a multi-channel moving raisin color and lustre real-time recognition algorithm was proposed. In order to ensure the accuracy of raisin colour and lustre feature extraction, it is necessary to preprocess every image acquired in real time. In this paper, component method was used to obtain the gray scale image of each image, the gray histogram of RGB image components was obtained by OpenCV open source function library, and finally the B-channel gray scale image was selected for threshold segmentation through observation. Through the B-channel gray histogram, 55 was selected as the segmentation threshold, and the image after threshold segmentation was obtained, i.e. binary image. Through morphological operation, the binary image was processed by etching first and then expanding, and the smooth and burr free binary image of raisin was obtained. A method to remove the incomplete raisin outline at the two sides of each binary image was proposed. The complete color information of raisin was obtained by the image boundary expansion, overflow filling and image clipping of binary image. The pper and lower area mask were established, and each frame image was processed separately by the mask, the image segmentation was realized, and the raisins on the two conveyor belts was recognized at the same time, and the recognition processing efficiency was improved. The rightmost contour of upper and lower region was found by traversing every raisin contour in the image, and only the rightmost raisin was recognized in the process of processing each frame of the image (the synchronized conveyor belt was transported from left to right), so as to simplify the data processing. In HSV space, the mean value of each channel was extracted from the first raisin on the rightmost of the two synchronized conveyor belt, and 40 raisins of green, yellow and brown were tested for value taking. Statistical data were analyzed and plotted with MATLAB, the results were that the threshold value of H component was 23, and that of V component was 80, which were used to identify and sort the raisins of three colors. 150 raisins of each color were selected were selected for the validation test, and each color was divided into three groups, 50 raisins in each group, 9 groups of tests were conducted. The results showed that the average recognition accuracy of green raisins was 89.33%, that of yellow raisins was 92.00%, and that of brown raisins was 96.67%, the recognition efficiency was 21 s/100 raisins, the method was simple and effective. The recognition efficiency of this method was higher than 110 s / 100 raisins of manual sorting, but the recognition accuracy was lower than 100% of manual sorting. Compared with the existing research methods, the recognition accuracy of this method for brown raisins was higher, but the recognition accuracy for yellow and green raisins was lower. The current raisin grading equipment in the market can hardly distinguish the yellow and green raisins, the paper provides a better method to distinguish the yellow and green raisins. The raisin colour and lustre recognition algorithm based on OpenCV open source function library was feasible and accurate, the coordinate information, colour and lustre information of the identified raisins were obtained, which provided the algorithm basis for the construction of the subsequent sorting actuator and control system, and provides the reference for the commercialization of raisin colour and lustre selection.