How can I detect each M&M individually?
I tried to mask the M&M's using:
- bilateral filtering on the saturation channel
- canny edge detection
- morphological closing to the edges
I would really appreciate if you could help me solve this.
For context, I am doing a detection of each M&M and classifying them in terms of color and if they have a nut. We have individual images of each M&M's by color and nut. Our framework would be to detect each individual M&M, calculating the area to segment if they have a nut or not, and afterwards compare the upper and lower bound of the HSV channels to segment by color. Is this approach correct or is it too inefficient?
This is my first Computer Vision project btw, any tips would be immensely appreciated.