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.
  • You can click on the output twice to change its name.

Labeling connections is explained in this article.

You can learn how to turn on sections here.

Solution (AVS)

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

  2. Setup fitting field like on the image below:

  3. Set inScanCount to 25.

  4. Set inScanWidth to 10.

  5. Set inEdgeScanParams.MinMagnitude to 10.000.

  6. Set inMaxIncompleteness to 0.700.

  7. Label the outSegment as Segment1

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

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

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

  11. Set inScanWidth to 10.

  12. Set inEdgeScanParams.MinMagnitude to 10.000.

  13. Set inEdgeScanParams.EdgeTransition to DarkToBright.

  14. Set inMaxIncompleteness to 0.700.

  15. Label the outSegment as Segment2

  16. To measure the angle between the found segments you can use a formula. You do not have to connect labeled outputs to the formula to be able to use them.

    Angle = angleDiff(Segment1.Direction, Segment2.Direction, 180)

Macrofilter Main

Used Filters

Icon Name Description
FitSegmentToEdges Precise detection of a straight edge, whose rough location is known beforehand.
EnumerateImages Emulates image acquisition with images stored on disk.

Further Readings