You are here: Start » Program Examples » Measuring the L-Pipe
Measuring the L-Pipe
Aim:
The task is to create an application that measures an angle and a width on an L-pipe.
Input:
An image of an L-pipe. The location of the object, including the orientation, is variable.
Output:
Application should measure following elements:
.
Hints:
This is a typical case for performing measurements aligned to an object's position.
In the first step, the object has to be located. We recommend the LocateSingleObject_Edges1 filter for this purpose. Next, the interesting contours of the objects have to be detected with Shape Fitting filters such as the FitSegmentToEdges.
It is important to appropriately connect the 'Alignment' inputs of these filters with the results of the Template Matching (outObject.Alignment). Finally, the measurements can be extracted with the AngleBetweenSegments.
Measurement of the pipe width can be done using the MeasureObjectWidth filter.
Labeling connections is explained in this article.
Solution (FIS):
-
In Workspace Explorer, open the workspace Examples, and in the Filmstrip window, select the the L_Pipe dataset. Drag the Image channel to the ACQUIRE section.
-
Next, a location of the pipe should be found. To perform this task, add the LocateSingleObject_Edges1 filter. Next, connect output image from the ReadFilmstrip.
-
Create the edge model using the Edge Model Editor as shown in the picture below.
-
In the next step, a reference coordinate system will be used to find two pipe's edges. Add two filters FitSegmentToEdges. Connect both inFittingFieldAlignment to the outObject.Alignment.
-
Measure the angle between found segments using the AngleBetweenSegments filter.
-
To find the L-Pipe width, add the MeasureObjectWidth filter. Connect the inScanFieldAlignment input with the outObject.Alignment output of the LocateSingleObject_Edges1 and select a scanning field as shown in the image below.
Main macrofilter calculates the pipe's dimensions from images.
Used Filters
Icon | Name | Description |
---|---|---|
![]() |
AngleBetweenSegments | Measures the angle between two segments with one of four possible metrics. |
![]() |
FitSegmentToEdges | Precise detection of a straight edge, 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. |
![]() |
MeasureObjectWidth | Measures the width of an object using stripe detection. |
Further Readings
- Shape Fitting - This article presents usage of the Shape Fitting technique.
- Template Matching - Most detailed description of the Template Matching technique.