Abstract:
Abstract: In agriculture field, the knowledge about the size of immature fruit in its growing period could be helpful to the aspects such as precision fertilization and irrigation, training and pruning, yield estimation and harvest stage determination. Thus, it can improve the fruit yield and quality. However, the most important premise is the fruit detection and the size calculation in natural condition. The color of fruits on tree is very similar with their surrounding objects, so that the recognition and size calculation is very difficult in natural condition. This paper proposed an algorithm of diameter measurement for immature apple based on the morphological reconstruction, the watershed and convex hull theory. Firstly, the images were acquired using the JV205 cameras which were installed in front of the apple trees with the distance of about 1-2 m, whose resolution was 4 608 pixels × 3456 pixels; and acquisition time was from June 1th, 2014 to September 30th, 2014. Before preprocessing, the images were cropped into 1400 pixels × 1100 pixels to get the scope of the target apples. In order to enhance the visibility of the target area, the morphological reconstruction operation was used before the edge detection. Secondly, the rough contour of target fruit was extracted by the dilation and erosion operation using micro-disk structure element with a radius of two pixels. After the above image preprocessing, excessive local minimum points, which were caused by occluded leaves and uneven illumination, were merged using the bresenham algorithm. And then the overlapping target fruits were segmented by distance transform and improved watershed algorithm. Later, the contours of segmented target region were tracked and the continuous smooth contour curve was extracted using convex hull on the edge of the segmentation images. Finally, the entire circle was reconstructed using the three different points on the reserved true target contour based on the circle feature principle. Thus, the center and radius parameters were estimated and the precise detection of target fruit was realized. In order to verify the algorithm accuracy, a total of 4 typical target apples and 96 images were selected in the experiments. The reference object, table tennis ball was 200 pixels and its actual size was 40 mm. So the calibration coefficient was 0.2 mm/pixel. The result of preprocessing showed that the image morphological reconstruction could not only weaken the brightness of the background, but also maintain the edge of target fruit. After the edge detection and structure expansion with a radius of two pixels, the contour of the fruit had been acquired, but there were some defects due to the fact that some fruits were shaded by leaves. At last, the calculated results were compared with the manual measurement ones. The experiment results showed that the minimum root mean square error (RMSE) and the mean value were 1.91 mm and 2.27 mm, respectively. In addition, it was found that the calculation result of the flat apples had larger error and the reason was that the radius of fitting circle was less than the actual one. The size class of fruit in market is mostly expressed in millimetre and the change from class size to another is often 5 mm or 0.5 cm. So without considering the flat apples, this method can meet the market fruit's grading requirement. In conclusion, the paper proposed a new approach to deal with segmentation for overlapping and occluded apples and to realize size detection and precise measurement of immature fruits in natural condition. And the results were consistent with the manual measurement, which could meet the producers' demand to precision management during the fruit growth period and had a good practicality.