You are here: Start » Program Examples » Gasket Inspection

Gasket Inspection

Aim:

The task is to measure the distance between the centers of gasket holes.

Input:

An image containing a gasket. The position of the gasket is variable.

Output:

Calculated distance between two pairs of holes.

Hints:

The location of the object is variable. Therefore, in the first step of an algorithm, the LocateSingleObject_Edges1 filter should be used. Then, its outObject.Alignment output can be used as a reference CoordinateSystem2D to subsequent filters. The centers of holes can be found using the FitCircleToEdges filters. The centers of the holes which are not closed can be found using the FitArcToEdges.

Labeling connections is explained in this article.

Solution (AVS):

  1. In Workspace Explorer, open the workspace Examples, and in the Filmstrip window, select the Gasket dataset. Drag the Image channel to the ACQUIRE section.
  2. To find the location of the gasket add the LocateSingleObject_Edges1 filter.
    • Click the "..." button at the inEdgeModel input to open the GUI for creating template matching models.
    • Select the template region which should contain characteristic edges of the object, but should not be too big.
    • Mark the SearchRegion, which is an area of possible object centers. Please note that, as in the case of the inEdgeModel the smaller the SearchRegion, results in the shorter execution time.
  3. Add two FitCircleToEdges filters. Connect to them an input image and the outObject.Alignment from the LocateSingleObject_Edges1 filter.
    • Click the "..." button at the inFittingField input and set the fitting field.
  4. Add the PointToPointDistance filter and connect to it the outCircle.Center from both FitCircleToEdges filters.
  5. Add two FitArcToEdges filters. Connect to them an input image and the outObject.Alignment from the LocateSingleObject_Edges1 filter.
    • Click the "..." button at the inFittingField input and set the fitting field.
  6. Add the PointToPointDistance filter and connect to it the outArc.Center from both FitArcToEdges filters.

Macrofilter Main

Used Filters

Icon Name Description
FitArcToEdges Precise detection of an arciform edge, whose rough location is known beforehand.
FitCircleToEdges Precise detection of a circular object or hole, whose rough location is known beforehand.
LocateSingleObject_Edges1 Detection of an object whose outlines are sharp and rigid. Often one of the first filters in a program.
PointToPointDistance Measures the distance between two points.

Further Readings

  • Shape Fitting - This article presents usage of the Shape Fitting technique.
  • Template Matching - Most detailed description of the Template Matching technique.