###### Abstract  
Accurate identification of fruits in greenhouse environments is an essential need for the precise functioning of agricultural robots. This study presents a solution to the problem of distinguishing cucumber fruits from their stems and leaves, which often have similar colors in their natural environment. The proposed algorithm for cucumber fruit identification relies on color segmentation and form matching. First, we get the boundary details from the acquired image of the cucumber sample. The edge information is described and reconstructed by utilizing a shape descriptor known as the Fourier descriptor in order to acquire a matching template image. Subsequently, we generate a multi-scale template by amalgamating computational and real-world data. The target image is subjected to color conditioning in order to enhance the segmenacktation of the target region inside the HSV color space. Then, the segmented target region is compared to the multi-scale template based on its shape. The method of color segmentation decreases the presence of unwanted information in the target image, hence improving the effectiveness of shape matching. An analysis was performed on a set of 200 cucumber photos that were obtained from the field. The findings indicate that the method presented in this study surpasses conventional recognition algorithms in terms of accuracy and efficiency, with a recognition rate of up to 86%. Moreover, the system has exceptional proficiency in identifying cucumber targets within greenhouses. This attribute renders it a great resource for offering technical assistance to agricultural robots that operate with accuracy. greenhouse environments; fruit recognition; color split; multi-scale; shape match +
Footnote †: journal:  
there is a noticeable difference in color between the fruit being targeted and its background. In specific circumstances, color characteristics are employed to identify fruits when the colors of the fruit and the background are alike, as seen with green apples, unripe green tomatoes, and cucumbers. [PERSON] [5] initially partitioned the target image into roughly equal rectangular sub-images. They computed the thresholds for each color component of the RGB image to achieve a uniform region of illumination. Subsequently, they transformed it into a three-dimensional spatial image using the natural difference index (NDI) and determined three distinct thresholds for each NDI dimension in every sub-image. This approach enabled the detection of red bell peppers with a high success rate, even in situations with significant variations in illumination. [PERSON] [6] successfully segmented green peppers by merging the H1 and S1 components of the HSI spatial model in the smoothing region, along with the ultra-green operator EXG (EXG = 2G-R-B). [PERSON] [7] constructed the H1 component of the super green operator EXG, the normalized g component, and the S1 component in both the RGB and HSV color spaces. The integration of a support vector machine and threshold classification enabled them to attain recognition of green apples. [PERSON] [8] substituted the green component in the RGB color space with the hue component (H2) in the HSV color space to create the composite image (RBH). This modification increased the distinction between the green tomato and its surrounding environment. The researchers employed a thresholding segmentation method to accomplish the initial segmentation of the green tomato. The color of fruits in natural settings can be readily influenced by various lighting conditions, resulting in color deficit. On the other hand, form features, which are another important characteristic of fruits, can be used to accurately separate and identify fruits. However, it is more difficult to describe and extract these features. Researchers have used shape descriptors, such as the histogram of oriented gradient (HOG), deformable part model (DPM), and Fourier descriptors, in target recognition systems.