Gear Exercise
Cogwheel of a Watch 
Goal: count the number of teeth of the cogwheel from a clock
Approach: the top hat of a small opening on the binary version could work, but the internal holes introduce parasites. Therefore, begin with a clohole, then the top hat followed by a mini opening for suppressing a few isolated points.
Keywords: binary tophat, clohole, EulerPoincarĂ© number
To obtain the teeth of the wheel the internal features at the same dimension or scale must be eliminated (example the thin joins of the gear at the center) â€“ We do this by filling the holes in the image. Now a simple dilation and difference from the filled image renders the teeth. We then perform a labelling to obtain the number of teeth.
1. Filled Wheel 
2. Opened Wheel (eroded by 10 and then dilated by 12) 

3. Difference to Extract the Teeth 
4. Labeling to count the teeth (120 teeth) 
Comment : Remember that there are 60 second in a minute, hence 120 teeth in the clock wheel.
Hits: 1987