You are here: Start » Tutorial Exercises » Counting Saw Teeth
Counting Saw Teeth
Aim:
Create an application that finds the number of a blade's teeth.
Input:
A single image of the saw blade.
Image is stored in the count_teeth directory.
Output:
The number of teeth.
Hints:
The teeth of the blade are located evenly around the mounting hole of the blade.
Locate the central mounting point using the DetectSingleCircle filter. Measure the blade radius using the measuring distance tool.
Blade teeth can be measured like stripes using the ScanMultipleStripes.
Use the CreateCirclePath filter to create a circular path for scanning. This filter converts a geometrical shape into a set of straight segments. It is necessary to select a value of inPointCount that will make scanning each tooth possible.
Labeling connections is explained in this article.
Solution (FIS):
-
Add the filter LoadImage to the ACQUIRE section to get an image from the file.
-
Measure the radius of the mounting hole using the measuring tool.
-
Add the DetectSingleCircle filter to the PROCESS section and set the value of expected circle radius to the measured radius.
-
Reduce the DetectSingleCircle ROI to the middle part of the image to increase detection speed.
-
Expand the outCircle.Circle output and get the Center property.
-
Add the CreateCirclePath filter, right-click on inCircle and expand the structure fields. Set the value of inPointCount to 50. Connect outCircle.Center with inCircle.Center and set inCircle.Radius to 125, which is the approximate distance between the center of the hole and the teeth of the blade.
-
Add the ScanMultipleStripes filter to find stripes crossing the prepared path. Connect outImage with inImage and connect outPath with inScanPath. Set inStripeScanParams.StripePolarity to Dark because the teeth are black.
-
Expand outStripes of the ScanMultipleStripes filter and get the Count property output.
-
Show outStripes.Count in a new preview window.
Video Tutorial
Main macrofilter calculates the teeth count by scanning stripes around a circular path.
Additional Tasks:
- Unroll the image along the circular path into a single straight image using ImageAlongPath.
- Find the mounting using the Blob Analysis techniques.
Further Readings
- 1D Edge Detection - The article explaining how edge detection filters work.
- Blob Analysis - Article presents detailed information about the Blob Analysis technique.
- Image Processing - A comprehensive introduction to Image Processing.