Shape Recognition - Mango Count

I would like to process a close-up of the mango tree so that I can identify and count the mangoes. Mango is roughly an oval or elliptical shape that is uniquely different from the leaves and branches in the image. I would like to be able to count mangoes that can be 20% covered by other objects (but still obvious to the human eye.) I believe that MatLab has an algorithm that could do this, and I would appreciate any help or suggestions.

+8
image-processing matlab image-recognition shape
source share
2 answers

I think a more reliable solution for this problem is to segment by the color of the mango from the background (i.e. the leaves of the tree) and count the number of connected components as a result of the binary image. As Batton noted, you can get connected binary image components using bwconncomp and labelmatrix .

To segment mangoes by color, first convert the image to HSV color space , and then binarize using the hue component. I believe that the shade component of the mango will be different from other parts of the image. This blog post gives some insight into how to do this in Matlab.

+4
source share

Perhaps you could:

  • Pre-process the image (grayscale / threshold, etc.).
  • Extract all counters / connected components from the binary image.
  • Calculate the area and perimeter of each loop component / connected component.
  • Calculate the shape factor / roundness using:

The form factor is (4 * PI * Area) / (Perimeter ^ 2). This gives an indication of the shape of the objects. Circles have the largest area for and this formula will approach a value of 1 for a perfect circle. The area is about 0.78. A thin thread-like object will have the lowest shape factor approaching 0.

Roundness - (perimeter ^ 2) / 4 * PI * Area). This gives a mutual value of the shape factor for those used for its use. The circle will have a value slightly greater than or equal to 1. Other shapes will increase in value.

So, could you approximate the shape factor for the “perfect” mango and see if any of the components are inside the approximation?

See more details.

+1
source share

All Articles