1) rgb model 3 channels
imgr=img 1(:,:, 1);
imgg=img 1(:,:,2);
imgb=img 1(:,:,3);
The gray histogram imhist(imgr) is obtained.
2) Simple binary im2bw or edge.
3) Feature extraction. According to the characteristics of bananas, strawberries and kiwifruit, the number of bananas, strawberries and kiwifruit is counted.
From the description of the experimental steps, it has been binarized, and feature extraction should be to extract shape features.
It is suggested to extract hu invariant distance (Baidu search has it)
If you count, you should be able to subtract the Euclidean distance.