Use Contours to Count Gear Teeth
Using the new contour properties in ImageMeasurements and ComponentMeasurements, develop a convex hull–based algorithm in order to identify and analyze the shape of gears and use it to count their teeth.
Build a small utility to get the ConvexHullMesh of the contours and compute the defects. Using PeakDetect, you can also find the point of minimal indentation.
The precomputed contour properties can be displayed in a vector graphic for easier visual inspection.
Write a utility function to show the sequence of distances of pixels on the contour to its convex hull.
Combine all the previous visualizations together with the estimated number of teeth.
Show the summary for the test gear.
Apply the function to a more complex image.
Group the gears by their approximate teeth count.
Inspect multiple coins.