## 4 Conclusions  
In this study, a new method was developed for segmentation of apple fruits on trees under natural light conditions without using any artificial background with emphasis on video processing. The most important results are:  
1. The most important challenges for the development of segmentation algorithm were the presence of different objects with different colors in a background. For example, a number of these objects include trees trunk in the shade, trunks of trees in the sun, tiny brunches in the shade, tiny brunches in the sun, tiny branches connected to trunks, green leaves in the sun, green leaves in the shade, pestle leaves, green plants, yellow plants, cloudy sky, sunny sky, artificial objects such as nylon, baskets, harvested apples, flakes and so on.
2. Appropriate color model among 17 color models examined was Lux. In fact, this model eliminates many leaves in the first stage.
3. The proper feature for performing the second stage of segmentation among the three texture features of local range, local entropy and local standard deviation was the local range.
4. The use of the intensity transformation method eliminated a large part of the pixels related to the trunk and tree branches.
5. The use of morphological operators in different stages of segmentation is necessary.
6. The use of color thresholds in the final stage of segmentation eliminates objects that have remained in the previous stages.  
\begin{table}
\begin{tabular}{c c c} \hline \hline
**Method** & **Number of Samples** & **Correct Detection Rate (Percent)** \\ \hline Proposed method & 102,875 (test data) & 99.013 \\ [14] & 68 & 83 \\ [15] & 152 & 95.72 \\ \hline \hline \end{tabular}
\end{table}
Table 8: Comparison of the results obtained in this study with two other studies.  
Results showed that the percentage of total detection of segmentation algorithm was 99.013%.
* The highest sensitivity was related to apple class with the value of 99.242% and the highest specificity was related to the class of background objects with a value of 99.458%.
* The results showed that the processor speed was about 0.825 seconds for the segmentation of a frame.  
For future work, a fruit recognition system should be implemented and vegetables to improve recognition functionality and flexibility for wider use.  
The process should be improved by extending its functions to process and recognize more variety of different fruit images. Besides that, a texture-based analysis technique could be combined with the existing three features analysis technique on the system in order to gain better discerning of different fruit images.  
Conceptualization, S.S. and Y.A.-G.; methodology, S.S., Y.A.-G., F.A., R.K.; and J.L.H.-H.; software, S.S.; validation, S.S., Y.A.-G., F.A., R.K.; and J.L.H.-H.; formal analysis, S.S., and J.L.H.-H.; investigation, S.S., Y.A.-G., F.A., R.K.; and J.L.H.-H.; resources, S.S.; data curation, S.S.; writing--original draft preparation, S.S.; writing--review and editing, J.L.H.-H.; visualization, S.S.; supervision, Y.A.-G.; project administration, Y.A.-G.; funding acquisition, Y.A.-G.  
This study was financially supported by Iran National Science Foundation (INSF) through the research project 96007466.  
The authors declare no conflicts of interest. The funders had no role in the design of the study; in the collection, analyses, or interpretation of data; in the writing of the manuscript, or in the decision to publish the results.