Skip to main content
. 2016 Dec 10;16(12):2098. doi: 10.3390/s16122098
Algorithm 2. The pseudo code of image segmentation and targets extraction.
Input: Captured vineyard images
  1. For all pixels in the image

  2.   If (H()>0)

  3.   Pixel binary value=1

  4.   Else

  5.   Pixel binary value =0

  6.   End

  7. End

  8. For all pixel regions(value for 1) in the binary image

  9.   Eliminate the regions which are smaller than 1/4 of the biggest region

  10.   Perform open and close operator to delete the adhesion noise

  11.   Fill the hole for every pixel regions

  12.   Draw the enclosing rectangle for every pixel regions

  13. End

Output: Binary image that contains only the grape clusters