You are here: Start » Program Examples » Measuring the L-Pipe (l_pipe)

Measuring the L-Pipe (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:

  1. An angle (blue) of type Real.
  2. A pipe width(violet) of type Real.

.

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 (AVS)

  1. In Workspace Explorer open workspace Examples and in Film strip window select the L_Pipe dataset. Drag the Image channel to the ACQUIRE section.

  2. Next, a location of pipe should be found. To perform this task add the LocateSingleObject_Edges1 filter. Next connect output image from the ReadFilmstrip.

  3. Create the edge model using the Edge Model Editor as shown in the picture below.

  4. In next step reference coordinate system will be used to find two pipe's edges. Add two filters FitSegmentToEdges. Connect both inFittingFieldAlignment to the outObject.Alignment.

  5. Measure angle between found segments using the AngleBetweenSegments filter.

  6. To find 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 on the image below.

Main macrofilter calculates pipe's dimensions from images.

Used Filters

Icon Name Description
MeasureObjectWidth Measures the width of an object using stripe detection.
AngleBetweenSegments Measures the angle between two segments with one of four possible metrics.
LocateSingleObject_Edges1 Detection of an object whose outlines are sharp and rigid. Often one of the first filters in a program.
FitSegmentToEdges Precise detection of a straight 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.