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:

The calculated angle between the segments representing the 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 the edges 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 (FIS):

  1. In the Workspace Explorer, open the workspace Examples, and in the Filmstrip window, select the 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 it to the output of the ReadFilmstrip.

  3. Set up the 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 another FitSegmentToEdges filter to find a segment that best matches the upper edge points.

  10. Set up the 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 don't 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