Measure Row Spacing
Use this tool to measure the distances of objects and gaps in row spacing, i.e., the distances of parallel edge pairs.
For this tool easyTouch is available. This means you may select the edges in a row spacing to be measured interactively in the image while the corresponding parameters are automatically adapted. Move the mouse over an edge in a row spacing you want to measure. MERLIC will display a preview of the suggested parallel edges in a row spacing. The position of the mouse pointer influences the search for the corresponding edge pairs, i.e., the corresponding edges are determined depending on which side the mouse pointer is positioned. MERLIC interprets the side on which the mouse is positioned as part of the objects to be measured and the other side as part of the gaps. Thus the preview of suggested edges changes if you move the mouse from one side of the edge to the other. If you want to measure the previewed row spacing, click on the edges to confirm the selection. The edges are processed in form of edge pairs. The parameters are automatically adjusted to fit the selected edges. However, they still can be adjusted manually at the corresponding connectors.
Alternatively you may use a region of interest (ROI) for the measuring. Draw an ROI into the image. If the ROI contains edges in a suitable row spacing that fit the current parameter settings, they are automatically determined and measured. The tool support the use of only one ROI. If multiple ROIs are available, either from a connection from a previous tool or by drawing multiple ROIs with the ROI buttons, only the ROI that was created last will be used for the processing.
Parameters
Basic Parameters
Image:
This parameter represents the input image in which the objects and gaps in row spacing are measured.
If a color image is used as input image for this tool, only the first channel, i.e., the red channel, is used for the processing.
Edge Contrast:
This parameter defines the contrast of the edges relative to the background. The parameter is defined as gray values and set to 10 by default. When a reference object in row spacing is selected for measuring, the "Edge Contrast" of its edges is instantly determined and adopted. However, you may also change its value manually at the corresponding connector.
Edge Transition:
This parameter defines the transition property of the edge pair of the selected object. The transition is determined from outside to inside. The parameter is set to "any" by default. When an edge pair of a reference object in row spacing is selected for the measuring, the "Edge Transition" is instantly determined.
The "Edge Transition" is determined depending on which side of the edge segment the mouse pointer is positioned and thus which side is selected as one of the objects to be measured. If the mouse is positioned at the side with the higher gray values, the "Edge Transition" is determined as "dark to light" since the transition is determined in the direction from outside to inside. Thus the position of the mouse pointer also influences how the value is determined by easyTouch.
|
Value |
Description |
|---|---|
|
light to dark |
The edges of the edge pairs change from light to dark, i.e., the edges change from higher to lower gray values. If this value is set, only edges with this transition property are measured. Other edge pairs are excluded from the measurement. |
|
dark to light |
The edges of the edge pairs change from dark to light, i.e., the edges change from lower to higher gray values. If this value is set, only edges with this transition property are measured. Other edge pairs are excluded from the measurement. |
|
any |
The edges of the edge pairs may change in either direction, i.e., the edges may change from higher to lower gray values and from lower to higher gray values. If this value is set, all edge pairs are included in the measurement. |
Edge Width:
This parameter defines the "Edge Width" of the edges in the row spacing. It is defined in pixels and set to 2 px by default. When the edges of a reference object in row spacing are selected for measuring, the "Edge Width" of the edges is instantly determined and adopted. However, you may also change its value manually at the corresponding connector.
Additional Parameters
ROI:
This parameter defines the region of interest (ROI) for the processing. By default ROI is defined to be empty. If you want to use an ROI for the processing, you either have to connect the parameter to an appropriate ROI result of a previous tool or you have to draw new ROIs into the image using the available ROI buttons.
The ROI is checked for edges in row spacing that fit to the current parameter settings, e.g., if the "Edge Transition" is set to "dark to light" the tool searches along the ROI orientation if there are edges in row spacing that change from dark to light. If suitable edges are found, they are used for the measurement.
This tool only supports the use of a single rectangular ROI. If the parameter contains multiple ROIs, only the last ROI that was created will be used for the processing.
Alignment Data:
This parameter represents the alignment data that are used to align the ROI. By default no alignment data are connected and thus no effect is visible. If you want to use specific alignment data, you have to connect the parameter to an appropriate result of a previous tool such as Determine Alignment with Matching, Determine Alignment with Straight Border, Align Image, or Rotate Image.
Calibration Data:
This parameter defines the calibration data needed for the correction of possible lens distortions and the position of the camera with respect to the image plane. By default no calibration data are defined. If you want to use calibration data, you have to connect the parameter to an appropriate result of a previous tool, e.g., Calibrate Camera, to make sure that the calibration data are transmitted to this tool. It will be instantly applied to the image.
In case "Calibration Data" are used for this tool, all results that represent pixel values will be automatically transformed to the corresponding world coordinates.
Reference Object Width:
This parameter defines an approximate width of the selected reference object, i.e., the distance between the edge pair that has been selected with the mouse using easyTouch. The "Reference Object Width" thus defines the expected width when searching for other edge pairs in the row spacing. It is defined in pixels and set to 2 px by default. When an edge pair of a reference object in row spacing is selected for measuring, the "Reference Object Width" is instantly determined and adopted. If necessary, change the value for the "Reference Object Width" at the corresponding connector.
Object Width Tolerance:
This parameter defines a tolerance value in percentage for the allowed width of the object in the row spacing. When an edge pair has been selected as reference object using easyTouch, further edge pairs are searched that may belong to a row spacing. The "Object Width Tolerance" defines how much the actual width of the objects in the row spacing may differ from the "Reference Object Width" which defines the width of the selected reference object.
The "Object Width Tolerance" is set to 0.9 by default. This means that the width of the objects may differ up to 90% from the width of the reference object. All parallel edge pairs of objects with a width within the defined tolerance are included in the measurement. The value of this parameter is not adjusted when selecting edge pairs in a row spacing using easyTouch. If necessary, change the "Object Width Tolerance" at the corresponding connector.
Results
Basic Results
Parallel Edges:
This result returns the graphical representation of the parallel edges that have been measured in the row spacing. They are returned as a rectangle ROI in which the ROI borders, perpendicular to the ROI orientation arrow, represent the parallel edges.
Object Widths:
This result returns the widths of the objects in the measured row spacing. They are defined by the distances between parallel edges of which each edge borders the same objects. The widths are returned in a tuple and specified in pixels as real numbers. In case "Calibration Data" is used, the distance is returned in world coordinates.
Gap Widths:
This result returns the widths of the gaps between the objects in the measured row spacing. They are defined by the distances between parallel edges of which each edge borders a different object. The width are returned in a tuple and specified in pixels as real numbers. In case "Calibration Data" are used, the distance is returned in world coordinates.
Center Distances:
This result returns the distances between the center points of the objects that have been measured. They are returned in a tuple and specified in pixels as a real number. In case "Calibration Data" ate used, the distance is returned in world coordinates. If only one object is found and measured, an empty tuple is returned.
Tool State:
"Tool State" returns information about the state of the tool and thus can be used for error handling. For more information, see Tool State Result
Additional Results
Processing Time:
This result returns the duration of the most recent execution of the tool in milliseconds. The result is provided as additional result. Therefore, it is hidden by default but it can be displayed via the button beside the tool results. For more information see the section Processing Time in the tool reference overview.
Application Examples
This tool is used in the following MERLIC Vision App examples:
- calibrate_for_ruler_changed_distance.mvapp
- calibrate_for_ruler_distorted.mvapp
- calibrate_for_ruler_simple.mvapp