Evaluate Contours
Use this tool to evaluate contours based on a specific feature.
This tool requires that the contours are available and delivered from a previous tool. Therefore, the parameter "Contours" must be connected with an appropriate result of a previous tool, e.g., Measure Opposite Edges.
Therefore, you first have to extract the contours to be evaluated in a previous tool and then connect the resulting contours to this tool.
For this tool easyTouch and easyTouch+ are available. This means you may filter the measured contours using "Minimum Feature Value" and "Maximum Feature Value" while all contours are measured and the corresponding parameters are adapted automatically.
To start the evaluation, select the feature you want to evaluate. The contours that already fit to the currently defined parameter setting are highlighted in the color defined for "accepted", green by default. To select a different contour, move the mouse over the desired contour to be evaluated. MERLIC will highlight the contours with similar properties that will be included in the evaluation in the defined easyTouch color, e.g., blue by default. The contours that will not be included in the evaluation are highlighted by the defined color for "rejected", e.g., red by default. If you want to evaluate the selected contour, click on it to confirm the selection. The parameters of the feature are automatically adjusted to fit the selected contours. However, they still can be adjusted manually at the corresponding connectors.
Alternatively you may evaluate contours based on fixed feature values. If the parameter values are set manually, all contours that fit to the parameter setting will be highlighted in the defined color for "ok", e.g., green by default.
Parameters
Basic Parameters
Image:
Use this parameter to set an image as background. This should usually be the image, the processed features e.g., contours or ROIs are based on. If no image is connected, the background will be black.
Contours:
This parameter represents the contours to be evaluated. The contours must be delivered from a previous tool. Therefore, you have to connect the parameter with the respective result of a previous tool. The connected contours are then evaluated with the selected feature.
Feature Name:
This parameter defines the name of the feature that is evaluated for the contours. It is set to "length" by default. This means that the length of the contours is evaluated. You may choose a different feature to be evaluated at the corresponding connector.
|
Value |
Description |
Value range |
Unit |
|---|---|---|---|
|
number |
The number of contours is used for the evaluation. |
0 ... 10 000 000 |
- |
|
index |
The zero-based index within the input array of the contours is used for the evaluation. This value can be used to check whether all contours with the requested indices are available. |
0 ... 10 000 000 |
- |
|
number of points |
The contours are evaluated based on the number of points in the point clouds given by contours. |
0 ... 10 000 000 |
- |
|
length |
The contours are evaluated based on their lengths. |
0 ... 10 000 000 |
pixel |
|
anisometry |
The contours are evaluated based on their anisometry. |
1 ... 10 000 000 |
- |
|
circularity |
The contours are evaluated based on their similarity of each input contour with a circle. If the input contour is not closed it will be closed automatically. The input contour must not intersect itself, otherwise the resulting parameter is not meaningful. The following formula is used:
The shape factor "circularity" of a circle is 1. If the contour encloses an elongated area "circularity" is smaller than 1. |
0 .. 1 |
- |
|
convexity |
The contours are evaluated based on their convexity for each input contour. If the input contour is not closed it will be closed automatically for the evaluation. The input contour must not intersect itself, otherwise the resulting parameter is not meaningful.The following formula is used:
The shape factor "convexity" is 1 if the contour is convex (e.g., a circle, etc.). If there are indentations "convexity" is smaller than 1. If more than one contour is passed, the numerical results of the shape factor are stored in a tuple in the same order as the respective contours. |
0 .. 1 |
- |
|
compactness |
The contours are evaluated based on their compactness, e.g., if the contour encloses an elongated area its value is > 1. |
1 ... 10 000 000 |
- |
|
x center |
The contours are evaluated based on the column coordinate of their center of gravity. |
0 ... 10 000 000 |
pixel |
|
y center |
The contours are evaluated based on the row coordinate of their center of gravity. |
0 ... 10 000 000 |
pixel |
|
width |
The contours are evaluated based on the widths of their enclosing rectangles parallel to the coordinate axes. |
0 ... 10 000 000 |
pixel |
|
height |
The contours are evaluated based on the heights of their enclosing rectangles parallel to the coordinate axes. |
0 ... 10 000 000 |
pixel |
|
outer radius |
The contours are evaluated based on the radius of the smallest circle that surrounds the contours. |
0 ... 10 000 000 |
pixel |
|
x start |
The contours are evaluated based on the column coordinates of the upper left corner point of their enclosing rectangle parallel to the coordinate axes. |
0 ... 10 000 000 |
pixel |
|
y start |
The contours are evaluated based on the row coordinates of the upper left corner point of their enclosing rectangle parallel to the coordinate axes. |
0 ... 10 000 000 |
pixel |
|
x end |
The contours are evaluated based on the column coordinates of the lower right corner point of their enclosing rectangle parallel to the coordinate axes. |
0 ... 10 000 000 |
pixel |
|
y end |
The contours are evaluated based on the row coordinates of the lower right corner point of their enclosing rectangle parallel to the coordinate axes. |
0 ... 10 000 000 |
pixel |
|
orientation |
The contours are evaluated based on their orientation. The determined orientation that is returned in the result "Feature Values" is given in a range between −90° and 90° since the contours can also be selected by their corresponding angle in the opposite quadrant. E.g., if "Minimum Feature Value" is set to 60° and "Maximum Feature Value" is set to 120°, all contours with an orientation between 60° to 90° and −90° to −60° are classified as accepted. This is the case because for the range from 90 to 120 the corresponding angles in the opposite quadrant range from −90 to −60.
|
−180 to 180 |
degrees |
|
maximum diameter |
The contours are evaluated based on their maximum distance between two points of each contour. |
0 ... 10 000 000 |
pixel |
|
major length |
The contours are evaluated based on the first half length of the enclosing rectangle of each contour. |
0 ... 10 000 000 |
pixel |
|
minor length |
The contours are evaluated based on the second half length of the enclosing rectangle of each contour. |
0 ... 10 000 000 |
pixel |
|
minimum gray value |
The contours are evaluated based on their minimum gray values. |
0 ... 255 |
gray values |
|
maximum gray value |
The contours are evaluated based on their maximum gray values. |
0 ... 255 |
gray values |
|
average gray value |
The contours are evaluated based on the mean gray values of each contour. |
0 ... 255 |
gray values |
|
median gray value |
The contours are evaluated based on the median of the gray values. |
0 ... 255 |
gray values |
|
gray value deviation |
The contours are evaluated based on the deviation of the gray values. |
0 ... 255 |
gray values |
Minimum Feature Value:
This parameter defines the minimum value of the evaluated feature. It is set to "20" by default. It is adjusted automatically when the contours to be evaluated are selected manually. You can also use this feature value as reference for the evaluation. Set the desired value at the connector and all contours that fit to the current parameter setting will be highlighted in green. You can set the value in the range from 0 to 10 000 000 but only as high as the "Maximum Feature Value". However, the actual value range depends on the currently selected feature, e.g., if "orientation" is selected for "Feature Name", the value can only be set between −180 and 180. Please see the table in the description of the parameter "Feature Name" for the available value range of each feature.
Maximum Feature Value:
This parameter defines the maximum value of the evaluated feature. It is set to "200" by default. It is adjusted automatically when the contours to be evaluated are selected manually. You can also use this feature value as reference for the evaluation. Set the desired value at the connector and all contours that fit to the current parameter setting will be highlighted in green. You can set the value in a range from 0 to 10 000 000 but only as low as the "Minimum Feature Value". However, the actual value range depends on the currently selected feature, e.g., if "orientation" is selected for "Feature Name", the value can only be set between −180 and 180. Please see the table in the description of the parameter "Feature Name" for the available value range of each feature.
Additional Parameters
Feature Value Tolerance:
This parameter defines a tolerance value for the defined feature in "Feature Name". This parameter is only relevant if easyTouch is used to determine feature values. Otherwise it does not influence the evaluation of the regions. Therefore, depending on the selected name at the parameter "Feature Name", the connector "Feature Value Tolerance" is grayed out. This means that it is not relevant for use as long as you are working with the current selected name.
The parameter is processed in different ways depending on the feature that is selected in "Feature Name". For some features it is used to define a percentage value by how much the actual feature values of the contours may exceed the values that are set in "Minimum Feature Value" and "Maximum Feature Value". For some other features it is used to define an absolute value by how much the actual feature values may exceed the minimum and maximum values. There are also some features, i.e., "number", and "index", for which the "Feature Value Tolerance" is not taken into account. The table below shows which features are affected and whether the percentage value or the absolute value is used.
The "Feature Value Tolerance" is set to "50" by default. If you use easyTouch to determine the maximum and minimum feature values of the selected contour, MERLIC will include all contours in the evaluation whose feature values lie in the defined tolerance value, e.g., if the feature "width" is selected in "Feature Name" and the "Feature Value Tolerance" is set to 100, all contours with a width of up to 100% larger or smaller than the selected contour are included in the evaluation. You have to change its value manually at the connector if necessary. You can set the value to a range from 0 to 200 using the slider.
|
Value |
Affected? |
Percentage value |
Absolute value |
|---|---|---|---|
|
number |
|
|
|
|
index |
|
|
|
|
number of points |
✔ |
✔ |
|
|
length |
✔ |
✔ |
|
|
anisometry |
✔ |
✔ |
|
|
circularity |
✔ |
✔ |
|
|
convexity |
✔ |
✔ |
|
|
compactness |
✔ |
✔ |
|
|
x center |
✔ |
|
✔ |
|
y center |
✔ |
|
✔ |
|
width |
✔ |
✔ |
|
|
height |
✔ |
✔ |
|
|
outer radius |
✔ |
✔ |
|
|
x start |
✔ |
|
✔ |
|
y start |
✔ |
|
✔ |
|
x end |
✔ |
|
✔ |
|
y end |
✔ |
|
✔ |
|
orientation |
✔ |
|
✔ |
|
maximum diameter |
✔ |
✔ |
|
|
major length |
✔ |
✔ |
|
|
minor length |
✔ |
✔ |
|
|
minimum gray value |
✔ |
|
✔ |
|
maximum gray value |
✔ |
|
✔ |
|
average gray value |
✔ |
|
✔ |
|
median gray value |
✔ |
|
✔ |
|
gray value deviation |
✔ |
|
✔ |
Results
Basic Results
Accepted Contours:
This result returns the accepted contours. They are visualized in the defined color setting for "ok", e.g., green by default. A contour is accepted if the value of the evaluated feature fits within the defined value range.
Rejected Contours:
This result returns the rejected contours. They are visualized in the defined color setting for "rejected", e.g., red by default. A contour is rejected if the value of the evaluated feature does not fit the defined value range and therefore lies outside of the allowed range.
Feature Values:
This result returns the actual feature values of the evaluated contours. They are returned in a tuple as a real number.
All Contours Accepted:
This result returns a boolean value that indicates if all contours have been accepted. If the feature values of all evaluated contours lie within the allowed value range, the value 1 is returned. If the feature value of at least one contour does not fit to the value range, the boolean value 0 is returned. If "index" is selected as feature for the evaluation, this result is an indicator whether all contours with the respective indices defined in "Minimum Feature Value" and "Maximum Feature Value" are available.
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
Number of Accepted Contours:
This result returns the number of accepted contours, i.e., the number of contours whose feature value fits to the allowed feature value range.
Number of Rejected Contours:
This result returns the number of rejected contours, i.e., the number of contours whose feature value does not fit to the allowed feature value range.
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: