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)

  1. Add EnumerateImages filter to get load consecutive images of some disk directory.

  2. Add FitSegmentToEdges filter to find a segment that best matches the upper edge points. Connect to it the output of EnumerateImages.

  3. Setup fitting field by clicking inFittingField in Filter Properties.

  4. Set inScanWidth to 10.

  5. Set inEdgeScanParams.MinMagnitude to 11.100.

  6. Set inEdgeScanParams.EdgeTransition to DarkToBright.

  7. Set inMaxIncompleteness to 0.700.

  8. Add another FitSegmentToEdges filter to find a segment that best matches the left edge points.

  9. Setup fitting field like on the image below:

  10. Set inScanCount to 25.

  11. Set inScanWidth to 10.

  12. Set inEdgeScanParams.MinMagnitude to 10.000.

  13. Set inMaxIncompleteness to 0.700.

  14. 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.

  15. 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:

  16. Connect its input to outAbsoluteAngle.

  17. 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.

Further Readings