300 o Citrus x Leaf a Background 250 -1 ,200 S150 -. O DO O 50 0 50 100 150 200 250 300 Red (gray level) Figure 4-9. Pixel distribution in 25 calibration images in red-green plane. Thresholds shown in Figures 4-7 and 4-8 were used for the binarization step. The algorithm classified a pixel as citrus fruit if it fell inside the thresholds; otherwise it was classified as a background class. An example of image processing steps for a typical citrus grove image is shown in Figure 4-10. This image is used as an example to explain various steps involved in the implementation of the fruit counting algorithm. Figure 4-10 (a) shows a sample color image in the validation data set. Fruits were extracted by applying binarization on the sample color image in HSI color plane. The binarized image is shown in Figure 4-10 (b). 4.2 Preprocessing The binarized images contained noise mainly due to the little overlap of the leaf class with the citrus class in the hue-saturation color plane. By applying a threshold of