## 1 Introduction  
Nowadays, agricultural automation is inevitable to reduce costs, minimize labor difficulty, decrease environmental impact, increase timely farming and crop quality, and brink transparency in the supply chain [1; 2]. One of the challenges of robots is to identify and harvest the rip fruits. In this regard, cameras and sensors in the robot's arms have also been used to evaluate the information [3]. Suchrobots that capture real-time images and touch-based information enable the data to be collected in a variety of ways, helping to expand and improve this approach. One of the most well-known techniques is image processing, which provides useful, simple, fast, and accurate information over manual techniques. Previous studies have used this technique to extract color, morphological, and texture feature of foods such as fish, fruits, and vegetables. The different pattern recognitions used to classify, analyze, sort, and evaluate foods depend on these features. Thus, image processing [4; 5; 6; 7; 8] and pattern recognition [9; 10] are the best way to determine the quality of crops. Since harvesting robots have to work in unstructured environments with natural light conditions, the image segmentation algorithm is extremely important because direct sunlight causes shadows in the image that lead to incorrect diagnosis of the system [11; 12]. [PERSON] et al. [13] studied the fruit detection and extraction of color and shape features of kiwifruit under natural light. Until recently, two methods have been used to reduce the effects of natural light on image processing: (a) improvement of imaging conditions before image acquisition and (b) enhancing image contrast such as the use of optical filters on camera lenses or artificial auxiliary sources to improve imaging [14]. Such methods can be effective but require the installation of large structures and high energy consumption that lead to the poor performance of agricultural robots in the orchard [15]. [PERSON] et al. [16] developed a new method for fruit segmentation under different lighting conditions that involved the use of advanced wavelet transforms to normalize object surface lighting. The Retinex algorithm was used to highlight the fruit object. The image was then analyzed using K-means clustering. Imaging was performed on sunny and cloudy days, and the results showed that the proposed algorithm was able to operate successfully under different lighting conditions. [PERSON] et al. [17] proposed a method for segmenting apples under orchard conditions. The goal was to find the color space with the least number of colors to apply the threshold. They examined 17 color spaces, and according to their reports, the best results were obtained by applying segmentation using color, texture, and intensity conversion, and the overall correct classification rate was 98.92%. [PERSON] et al. [18] categorized farm images under natural light conditions. Based on the color space, eight color features of the images were extracted that included three components of HSL, the second and third components of HSV, and three components of HIS. Then, five specific vectors selected by principal component analysis (PCA) were selected to reduce the dimensionality of the images. The performance of using multiple color spaces in combination with PCA and RBF showed that the correct classification rates of sunny and cloudy days in the same scenes and different scenes were 100%, 87.36%, and 84.58%, 68.11%, respectively. However, this classification accuracy is not enough for practical use in machine vision systems as it results in many errors. [PERSON] et al. [19] proposed an approach to color processing that could provide optimal color space for plant/soil segmentation. It evaluated all possible options and developed color models in optimal spaces and channels. This prevented dependence on plant type, camera, and illumination conditions. The basis of their proposal was to use non-parametric models for the probability density functions of the plant/soil.