Skip to content

1D measuring🔗

More Info

Learn about 1D measuring and many other topics in interactive online courses at our MVTec Academy.

With 1D measuring, edges, i.e., transitions from light to dark or from dark to light, can be located along a predefined line or arc. This allows you to measure the dimension of parts fast and easily with high accuracy.

Note

If you want to measure the dimensions of geometric primitives like circles, ellipses, rectangles, or lines, and approximate values for the positions, orientations, and geometric shapes are known, 2D measuring may be a suitable alternative.

 

Figure 1. Measure edges and the distances between them along a line or along an arc . These images are from the example programs fuzzy_measure_pin.hdev and measure_ring.hdev.

Performing a 1D measuring🔗

In the following, the steps that are required to use 1D measuring are described briefly.

  1. Generate measure object:

    Generate a measure object that describes the region of interest for the measurement. If the measurement should be performed along a line, the measure object is defined by a rectangle. If it should be performed along an arc, the measure object is defined as an annular arc. The measure objects are generated by one of the following operators:

    Tip

    You can use shape-based matching to automatically align the measure objects.

  2. Perform the measurement:

    To perform the actual measurement, typically one of the following operators is used:

    • measure_pos extracts straight edges perpendicular to the main axis of the measure object. It returns the positions of the edge centers, the edge amplitudes, and the distances between consecutive edges.

    • measure_pairs extracts straight edge pairs perpendicular to the main axis of the measure object. It returns the positions of the edge centers of the edge pairs, the edge amplitudes for the edge pairs, the distances between the edges of an edge pair, and the distances between consecutive edge pairs.

    • measure_thresh extracts points with a particular gray value along the main axis of the measure object. It returns their positions and the distances between consecutive points.

    Alternatively, if there are extra edges that do not belong to the measurement, fuzzy measuring can be applied. Here, so-called fuzzy rules, which describe the features of good edges, must be defined. Possible features are, for example, the position, the distance, the gray values, or the amplitude of edges. These functions are created with create_funct_1d_pairs and passed to the tool with set_fuzzy_measure or set_fuzzy_measure_norm_pair. Then, based on these rules, one of the following operators will extract the most appropriate edges:

    • fuzzy_measure_pos extracts straight edges perpendicular to the main axis of the measure object. It returns the positions of the edge centers, the edge amplitudes, the fuzzy scores, and the distances between consecutive edges.

    • fuzzy_measure_pairs extracts straight edge pairs perpendicular to the main axis of the measure object. It returns the positions of the first and second edges of the edge pairs, the edge amplitudes for the edge pairs, the positions of the centers of the edge pairs, the fuzzy scores, the distances between the edges of an edge pair, and the distances between consecutive edge pairs.

    • fuzzy_measure_pairing is similar to fuzzy_measure_pairs with the exception that it is also possible to extract interleaving and included pairs using the parameter Pairing.

    Alternatively to the automatic extraction of edges or points within the measure object, you can also extract a one-dimensional gray value profile perpendicular to the rectangle or annular arc and evaluate this gray value information according to your needs. The gray value profile within the measure object can be extracted with the operator

  3. Destroy measure object handle:

    When you no longer need the measure object, you destroy it by passing the handle to

Further operators🔗

In addition to the operators mentioned above, you can use