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 the 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. In Workspace Explorer open workspace Examples and in Film strip window select Blade dataset. Drag the Image channel to the ACQUIRE section.

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

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

  4. Set inScanCount to 25.

  5. Set inScanWidth to 10.

  6. Set inEdgeScanParams.MinMagnitude to 10.000.

  7. Set inMaxIncompleteness to 0.700.

  8. Label the outSegment as Segment1

  9. Add the another FitSegmentToEdges filter to find a segment that best matches the upper edge points.

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

  11. Set the inScanWidth to 10.

  12. Set the inEdgeScanParams.MinMagnitude to 10.000.

  13. Set the inEdgeScanParams.EdgeTransition to DarkToBright.

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

    outAngle = 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.

Further Readings