This project is a gear teeth (cog) detector and counter using classic Computer Vision techniques with OpenCV.
The background of the input images is expected to be lighter than the object, just like in the example image:
The image processing techniques applied to detect and count the cogs are the following:
- Detect gear by segmenting the image.
- Detect the inner circle by morphological opening region.
- Obtain cog pixels by subtracting inner circle of the segmented image.
- Detect cogs by finding connected components.
The result for the example image is: 35 cogs