mmdgear - Detect the teeth of a gear
-
Description
- The input image is a binary image of a gear. The opening top-hat is used to detect the gear teeth. Finally, the teeth detected are labeled.
Reading
The binary image of a gear is read.
Opening and subtraction
Opening of the input image by an Euclidean disk of radius 20. The sequence opening-subtraction is called opening top-hat. The opening top-hat could be executed in a single command: c = mmopenth(a,mmsedisk(20));
Labeling and counting
The teeth detected are labeled. The maximum pixel value in the labeled image gives the number of connected objects (n. of teeth).