You are here: Start » Program Examples » Blade
Blade
Aim
The task is to check whether a blade is broken.
Input
An image of a blade. The position of the object is variable, but limited.

Output
Calculated angle between the segments representing upper and left edges of a blade's tooth.

Hints
As variations of the object positions are limited, you do not have to locate its exact position. Use the filters from Scan Edged 1D group to detect edged of a tooth.
Solution (AVS)
-
Add EnumerateImages filter to get load consecutive images of some disk directory.
-
Add FitSegmentToEdges filter to find a segment that best matches the upper edge points. Connect to it the output of EnumerateImages.
-
Setup fitting field by clicking inFittingField in Filter Properties.

-
Set inScanWidth to 10.
-
Set inEdgeScanParams.MinMagnitude to 11.100.
-
Set inEdgeScanParams.EdgeTransition to DarkToBright.
-
Set inMaxIncompleteness to 0.700.
-
Add another FitSegmentToEdges filter to find a segment that best matches the left edge points.
-
Setup fitting field like on the image below:

-
Set inScanCount to 25.
-
Set inScanWidth to 10.
-
Set inEdgeScanParams.MinMagnitude to 10.000.
-
Set inMaxIncompleteness to 0.700.
-
Now you can measure the angle between the found segments, to do this add AngleBetweenSegments filter and connect inSegment1 and inSegment2 to the output of the individual FitSegmentToEdges filters.
-
By iterating the program you can notice that undamaged blade has the calculated angle in certain range. Thus, add TestRealInRange filter and set its parameters:
-
Connect its input to outAbsoluteAngle.
-
Value of output outIsInRange is an inspection result.
Macrofilter Main

Used Filters
| Icon | Name | Description |
|---|---|---|
| AngleBetweenSegments | Measures the angle between two segments with one of four possible metrics. | |
| FitSegmentToEdges | Precise detection of a straight edge, whose rough location is known beforehand. | |
| EnumerateImages | Emulates image acquisition with images stored on disk. | |
| TestRealInRange | Checks whether a real value is in the specified range. |
