You are here: Start » Program Examples » Gasket Inspection
Gasket Inspection
Aim
The task is to measure a distance between 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
Location of 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. Centers of holes can be found using the FitCircleToEdges filters. Centers of the holes which are not closed can be found using the FitArcToEdges.
Labeling connections is explained in this article.
Solution (FIS)
- In Workspace Explorer open workspace Examples and in Film strip window select Gasket dataset. Drag the Image channel to the ACQUIRE section.
- To find 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 be not 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.
- 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.
- Add the PointToPointDistance filter and connect to it the outCircle.Center from the both FitCircleToEdges filters.
- 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.
- Add the PointToPointDistance filter and connect to it the outArc.Center from both FitArcToEdges filters.
Macrofilter Main
Used Filters
Icon | Name | Description |
---|---|---|
![]() |
LocateSingleObject_Edges1 | Detection of an object whose outlines are sharp and rigid. Often one of the first filters in a program. |
![]() |
FitCircleToEdges | Precise detection of a circular object or hole, whose rough location is known beforehand. |
![]() |
PointToPointDistance | Measures the distance between two points. |
![]() |
FitArcToEdges | Precise detection of an arciform edge, whose rough location is known beforehand. |
Further Readings
- Shape Fitting - This article presents usage of the Shape Fitting technique.
- Template Matching - Most detailed description of the Template Matching technique.