MIL_ID EdgeResultId, | //in |
MIL_INT64 Operation, | //in |
MIL_INT64 SelectionCriterion, | //in |
MIL_INT64 Condition, | //in |
MIL_DOUBLE Param1, | //in |
MIL_DOUBLE Param2 | //in |
This function selects edges that meet a specified criterion. These edges will be included in or excluded from future operations (calculations and result retrieval), or deleted entirely from the Edge Finder result buffer. To call this function, MedgeCalculate() must have been called at least once.
If this function is not called at least once, all edges are included by default. If there is more than one call to this function, the effect of the calls is cumulative, unless M_INCLUDE_ONLY or M_EXCLUDE_ONLY is specified as the operation to perform.
Once an edge has been excluded, it can typically be re-included by specifying M_INCLUDE or M_INCLUDE_ONLY in a future call to this function (with the correct criterion). However, if you use the result buffer with different images (in a call to MedgeCalculate()), all results in the result buffer are discarded and all new edges are re-included.
Unlike most other MIL functions, if the edges were extracted from a calibrated source image, you must specify relevant values in world units, although you will have control over the units when retrieving results using MedgeGetResult().
You can use this function to select edges based on one of the following:
A calculated edge feature (see MedgeControl()), where the edge selection depends on whether the specified edge feature meets the specified condition.
The inter-relationship of edges, where the edge selection depends on whether edges meet the specified box or chain condition of the specified edge or group of edges.
The current status of edges, where the edge selection depends on a specific edge, all edges, all included edges, or all excluded edges. These will be included, included only, excluded, excluded only, or deleted. For example, you can include only (M_INCLUDE_ONLY) the excluded edges (M_EXCLUDED_EDGES), which will essentially swap the previously included and excluded edges.
The proximity of an edge or edges to a specified point, where the edge selection depends on the specified radius, and the nearest neighbor condition.
You can also use this function to crop and select a portion of a specified edge.
For more information on the different uses of this function, see the Calculating and retrieving results section of Chapter 8: Edge Finder and the Advanced edge extraction section of Chapter 8: Edge Finder.
Specifies the identifier of the Edge Finder result buffer to be used in the edge selection process.
Specifies the operation to perform on the specified edges. Set this parameter to one of the following values.
For specifying the operation
|
|||||||||||||||||||||||||||||||||||||||
Value | Description
|
||||||||||||||||||||||||||||||||||||||
M_DELETE |
Deletes edges that meet the specified condition. (more details...) |
||||||||||||||||||||||||||||||||||||||
M_EXCLUDE |
Excludes all edges that meet the specified condition. (more details...) |
||||||||||||||||||||||||||||||||||||||
M_EXCLUDE_ONLY |
Excludes only those edges that meet the specified condition and includes all others. (more details...) |
||||||||||||||||||||||||||||||||||||||
M_INCLUDE |
Includes all edges that meet the specified condition. (more details...) |
||||||||||||||||||||||||||||||||||||||
M_INCLUDE_ONLY |
Includes only those edges that meet the specified condition and excludes all others. (more details...) |
Specifies on what the selection criterion will be based. Note that for certain selection criteria, this parameter can be set to M_NULL.
To specify an edge selection based on edge features, the SelectionCriterion parameter must be set to one of the values below. The specified feature will be used as part of the selection criterion. Note that the specified Edge Finder result buffer must already contain the results for the specified feature (for more information on each edge feature, see MedgeControl()).
For specifying the selection
criterion
|
|||||||||||||||||||||||||||||||||||||||
Value | Description
|
||||||||||||||||||||||||||||||||||||||
M_AVERAGE_STRENGTH |
Uses the average strength. |
||||||||||||||||||||||||||||||||||||||
M_BOX_X_MAX |
Uses the extreme right edgel coordinate. |
||||||||||||||||||||||||||||||||||||||
M_BOX_X_MIN |
Uses the extreme left edgel coordinate. |
||||||||||||||||||||||||||||||||||||||
M_BOX_Y_MAX |
Uses the extreme bottom edgel coordinate. |
||||||||||||||||||||||||||||||||||||||
M_BOX_Y_MIN |
Uses the extreme top edgel coordinate. |
||||||||||||||||||||||||||||||||||||||
M_CENTER_OF_GRAVITY_X |
Uses the center of gravity's X-position. |
||||||||||||||||||||||||||||||||||||||
M_CENTER_OF_GRAVITY_Y |
Uses the center of gravity's Y-position. |
||||||||||||||||||||||||||||||||||||||
M_CIRCLE_FIT_CENTER_X |
Uses the X-coordinate of the center of the circle that is the best fit for each edge. |
||||||||||||||||||||||||||||||||||||||
M_CIRCLE_FIT_CENTER_Y |
Uses the Y-coordinate of the center of the circle that is the best fit for each edge. |
||||||||||||||||||||||||||||||||||||||
M_CIRCLE_FIT_COVERAGE |
Uses the coverage of the circle that is the best fit for each edge. |
||||||||||||||||||||||||||||||||||||||
M_CIRCLE_FIT_ERROR |
Uses the fit error of the circle that is the best fit for each edge. |
||||||||||||||||||||||||||||||||||||||
M_CIRCLE_FIT_RADIUS |
Uses the radius of the circle that is the best fit for each edge. |
||||||||||||||||||||||||||||||||||||||
M_CLOSURE |
Uses the closure state. |
||||||||||||||||||||||||||||||||||||||
M_CONVEX_PERIMETER |
Uses the convex elongation. |
||||||||||||||||||||||||||||||||||||||
M_ELLIPSE_FIT_ANGLE |
Uses the angle between the major axis of the ellipse and the X-axis. |
||||||||||||||||||||||||||||||||||||||
M_ELLIPSE_FIT_CENTER_X |
Uses the X-coordinate of the center of the ellipse that is the best fit for each edge. |
||||||||||||||||||||||||||||||||||||||
M_ELLIPSE_FIT_CENTER_Y |
Uses the Y-coordinate of the center of the ellipse that is the best fit for each edge. |
||||||||||||||||||||||||||||||||||||||
M_ELLIPSE_FIT_COVERAGE |
Uses the coverage of the ellipse that is the best fit for each edge. |
||||||||||||||||||||||||||||||||||||||
M_ELLIPSE_FIT_ERROR |
Uses the fit error of the ellipse that is the best fit for each edge. |
||||||||||||||||||||||||||||||||||||||
M_ELLIPSE_FIT_MAJOR_AXIS |
Uses the major axis of the ellipse that is the best fit for each edge. |
||||||||||||||||||||||||||||||||||||||
M_ELLIPSE_FIT_MINOR_AXIS |
Uses the minor axis of the ellipse that is the best fit for each edge. |
||||||||||||||||||||||||||||||||||||||
M_FAST_LENGTH |
Uses the quickly calculated length. |
||||||||||||||||||||||||||||||||||||||
M_FERET_ELONGATION |
Uses the Feret elongation. |
||||||||||||||||||||||||||||||||||||||
M_FERET_MAX_ANGLE |
Uses the maximum Feret angle. |
||||||||||||||||||||||||||||||||||||||
M_FERET_MAX_DIAMETER |
Uses the maximum Feret diameter. |
||||||||||||||||||||||||||||||||||||||
M_FERET_MEAN_DIAMETER |
Uses the average Feret diameter at all the angles checked (see M_NUMBER_OF_FERETS in MedgeControl()). |
||||||||||||||||||||||||||||||||||||||
M_FERET_MIN_ANGLE |
Uses the minimum Feret angle. |
||||||||||||||||||||||||||||||||||||||
M_FERET_MIN_DIAMETER |
Uses the minimum Feret diameter. |
||||||||||||||||||||||||||||||||||||||
M_FERET_X |
Uses the X-Feret value. |
||||||||||||||||||||||||||||||||||||||
M_FERET_Y |
Uses the Y-Feret value. |
||||||||||||||||||||||||||||||||||||||
M_FIRST_POINT_X |
Uses the first point's X-coordinate. |
||||||||||||||||||||||||||||||||||||||
M_FIRST_POINT_Y |
Uses the first point's Y-coordinate. |
||||||||||||||||||||||||||||||||||||||
M_GENERAL_FERET |
Uses the general Feret. |
||||||||||||||||||||||||||||||||||||||
M_LABEL_VALUE |
Uses the label value. |
||||||||||||||||||||||||||||||||||||||
M_LENGTH |
Uses the length. |
||||||||||||||||||||||||||||||||||||||
M_LINE_FIT_A |
Uses the A variable of the line that is the best fit for each edge. |
||||||||||||||||||||||||||||||||||||||
M_LINE_FIT_B |
Uses the B variable of the line that is the best fit for each edge. |
||||||||||||||||||||||||||||||||||||||
M_LINE_FIT_C |
Uses the C variable of the line that is the best fit for each edge. |
||||||||||||||||||||||||||||||||||||||
M_LINE_FIT_ERROR |
Uses the fit error of the line that is the best fit for each edge. |
||||||||||||||||||||||||||||||||||||||
M_MOMENT_ELONGATION |
Uses the moment elongation. |
||||||||||||||||||||||||||||||||||||||
M_POSITION_X |
Uses the X-position. |
||||||||||||||||||||||||||||||||||||||
M_POSITION_Y |
Uses the Y-position. |
||||||||||||||||||||||||||||||||||||||
M_SIZE |
Uses the number of edgels. |
||||||||||||||||||||||||||||||||||||||
M_STRENGTH |
Uses the strength. |
||||||||||||||||||||||||||||||||||||||
M_TORTUOSITY |
Uses the tortuosity measure. |
||||||||||||||||||||||||||||||||||||||
M_X_MAX_AT_Y_MAX |
Uses the maximum X-coordinate at the maximum Y-coordinate. |
||||||||||||||||||||||||||||||||||||||
M_X_MIN_AT_Y_MIN |
Uses the minimum X-coordinate at the minimum Y-coordinate. |
||||||||||||||||||||||||||||||||||||||
M_Y_MAX_AT_X_MIN |
Uses the maximum Y-coordinate at the minimum X-coordinate. |
||||||||||||||||||||||||||||||||||||||
M_Y_MIN_AT_X_MAX |
Uses the minimum Y-coordinate at the maximum X-coordinate. |
To specify an edge selection based on the inter-relationship of edges, you must set the SelectionCriterion parameter to either a specific edge, or to a group of edges. In this case, the SelectionCriterion parameter defines the subset of edges to look inside (M_INSIDE_...) or outside (M_OUTSIDE...); that is, the edges to operate on are those relative to the edge(s) specified by the SelectionCriterion parameter. Note that some Operation and SelectionCriterion parameter values, when used together, do not have any effect, such as excluding (M_EXCLUDE) all the excluded edges (M_EXCLUDED_EDGES).
To specify the edge(s), set SelectionCriterion to one of the following values:
For specifying the edge(s)
|
|||||||||||||||||||||||||||||||||||||||
Value | Description
|
||||||||||||||||||||||||||||||||||||||
M_ALL_EDGES |
Specifies all edges regardless of their present status, except for edges that have been deleted. |
||||||||||||||||||||||||||||||||||||||
M_EXCLUDED_EDGES |
Specifies all currently excluded edges, except for edges that have been deleted. |
||||||||||||||||||||||||||||||||||||||
M_INCLUDED_EDGES |
Specifies all currently included edges, except for edges that have been deleted. |
||||||||||||||||||||||||||||||||||||||
M_SPECIFIC_EDGE |
Specifies a specific edge. (more details...) |
To specify an edge selection based on the current status of edges, the SelectionCriterion parameter must specify the edge or the status of the edges on which to operate. Note that in this case, the SelectionCriterion parameter should be set to one of the same values as an edge selection based on the inter-relationship of edges (see above).
To specify an edge selection based on the proximity of the edges to a point, the SelectionCriterion parameter must be set to M_NULL.
To crop and select a portion of a specified edge, the SelectionCriterion parameter must be set to the following value:
For cropping and selecting a portion of a
specified edge
|
|||||||||||||||||||||||||||||||||||||||
Value | Description
|
||||||||||||||||||||||||||||||||||||||
M_CROP_CHAIN |
Specifies a chain cropping. (more details...) |
Specifies the condition for the edge selection. Note that for certain selection criteria, this parameter can be set to M_NULL.
To specify an edge selection based on edge features, the Condition parameter must either be set to a condition that uses one limit, or a condition that uses two limits.
To crop and select a portion of a specified edge, the Condition parameter must be set to a condition that uses one limit.
For conditions that use one limit, set the Condition parameter to one of the values below. Note that, unless otherwise specified, these values are valid for both feature-based and crop-based edge selections.
For conditions that use one
limit
|
|||||||||||||||||||||||||||||||||||||||
Value | Description
|
||||||||||||||||||||||||||||||||||||||
M_EQUAL |
Specifies that edges with values for the specified feature equal to Param1 are included, excluded, or deleted from future operations on the specified Edge Finder result buffer. (more details...) |
||||||||||||||||||||||||||||||||||||||
M_GREATER |
Specifies that edges with values for the specified feature greater than the specified limit value are included, excluded, or deleted from future operations on the specified Edge Finder result buffer. (more details...) |
||||||||||||||||||||||||||||||||||||||
M_GREATER_OR_EQUAL |
Specifies that edges with values for the specified feature greater than or equal to the specified limit value are included, excluded, or deleted from future operations on the specified Edge Finder result buffer. (more details...) |
||||||||||||||||||||||||||||||||||||||
M_LESS |
Specifies that edges with values for the specified feature less than the specified limit value are included, excluded, or deleted from future operations on the specified Edge Finder result buffer. (more details...) |
||||||||||||||||||||||||||||||||||||||
M_LESS_OR_EQUAL |
Specifies that edges with values for the specified feature less than or equal to the specified limit value are included, excluded, or deleted from future operations on the specified Edge Finder result buffer. (more details...) |
||||||||||||||||||||||||||||||||||||||
M_NOT_EQUAL |
Specifies that edges with values for the specified feature not equal to Param1 are included, excluded, or deleted from future operations on the specified Edge Finder result buffer. (more details...) |
For conditions that use two limits, set the Condition parameter to one of the values below. Note that these values are only valid for feature-based edge selections.
For conditions that use two
limits
|
|||||||||||||||||||||||||||||||||||||||
Value | Description
|
||||||||||||||||||||||||||||||||||||||
M_IN_RANGE |
Specifies that edges with values for the specified feature in the range Param1 to Param2, inclusive, are included, excluded, or deleted from future operations on the specified Edge Finder result buffer. |
||||||||||||||||||||||||||||||||||||||
M_OUT_RANGE |
Specifies that edges with values for the specified feature less than Param1, or greater than Param2, are included, excluded, or deleted from future operations on the specified Edge Finder result buffer. |
To specify an edge selection based on the inter-relationship of edges, set the Condition parameter to one of the following box or chain values:
For specifying an edge selection based on
the inter-relationship of edges
|
|||||||||||||||||||||||||||||||||||||||
Value | Description
|
||||||||||||||||||||||||||||||||||||||
M_INSIDE_BOX |
Specifies that edges inside the bounding box of the specified edge, or inside the bounding box of the edges of the specified group, are included, excluded, or deleted from future operations on the specified Edge Finder result buffer. |
||||||||||||||||||||||||||||||||||||||
M_INSIDE_CHAIN |
Specifies that edges inside the specified edge, or inside edges of the specified group, are included, excluded, or deleted from future operations on the specified Edge Finder result buffer. (more details...) |
||||||||||||||||||||||||||||||||||||||
M_INSIDE_OR_EQUAL_BOX |
Specifies that edges inside or equal to the bounding box of the specified edge, or inside or equal to the bounding box of the edges of the specified group, are included, excluded, or deleted from future operations on the specified Edge Finder result buffer. |
||||||||||||||||||||||||||||||||||||||
M_INSIDE_OR_EQUAL_CHAIN |
Specifies that edges inside or equal to the specified edge, or inside or equal to the edges of the specified group, are included, excluded, or deleted from future operations on the specified Edge Finder result buffer. (more details...) |
||||||||||||||||||||||||||||||||||||||
M_OUTSIDE_BOX |
Specifies that edges outside the bounding box of the specified edge, or outside the bounding box of the edges of the specified group, are included, excluded, or deleted from future operations on the specified Edge Finder result buffer. |
||||||||||||||||||||||||||||||||||||||
M_OUTSIDE_CHAIN |
Specifies that edges outside the specified edge, or outside edges of the specified group, are included, excluded, or deleted from future operations on the specified Edge Finder result buffer. (more details...) |
||||||||||||||||||||||||||||||||||||||
M_OUTSIDE_OR_EQUAL_BOX |
Specifies that edges outside or equal to the bounding box of the specified edge, or outside or equal to the bounding box of the edges of the specified group, are included, excluded, or deleted from future operations on the specified Edge Finder result buffer. |
||||||||||||||||||||||||||||||||||||||
M_OUTSIDE_OR_EQUAL_CHAIN |
Specifies that edges outside or equal to the specified edge, or outside or equal to edges of the specified group, are included, excluded, or deleted from future operations on the specified Edge Finder result buffer. |
To specify an edge selection based on the current status of edges, set Condition to M_NULL.
To specify an edge selection based on the proximity of the edges to a point, set the Condition parameter to one of the following neighbor values:
For specifying an edge selection based on
the current status of edges
|
|||||||||||||||||||||||||||||||||||||||
Value | Description
|
||||||||||||||||||||||||||||||||||||||
M_ALL_NEAREST_NEIGHBORS |
Specifies that the closest edges within the specified radius and location is included, excluded, or deleted from future operations on the specified Edge Finder result buffer. (more details...) |
||||||||||||||||||||||||||||||||||||||
M_NEAREST_NEIGHBOR |
Specifies that the closest edge within the specified radius and location is included, excluded, or deleted from future operations on the specified Edge Finder result buffer. (more details...) |
Specifies a value that is dependent on the feature and condition chosen. If the edges have been calculated using a calibrated source image, you must specify the relevant values in the real world.
To specify an edge selection based on edge features, where the condition uses one limit, set Param1 to the required condition limit. To specify an edge selection based on edge features, where the condition uses two limits, set Param1 to the low condition limit.
To specify an edge selection based on the inter-relationship of edges, where SelectionCriterion is set to a specific edge (M_SPECIFIC_EDGE), set Param1 to the label value of the edge. To specify an edge selection based on the inter-relationship of edges, where SelectionCriterion is set to a group of edges (M_ALL_EDGES, M_EXCLUDED_EDGES, M_INCLUDED_EDGES), set Param1 to M_NULL.
To specify an edge selection based on the current status of edges, set Param1 to M_NULL.
To specify an edge selection based on the proximity of the edges to a point, set Param1 to the X-coordinate of this point.
To crop and select a portion of a specified edge (M_CROP_CHAIN), set Param1 to the label value of the edge to crop.
Specifies a value that is dependent on the feature and condition chosen. If the edges have been calculated using a calibrated source image, you must specify the relevant values in the real world.
To specify an edge selection based on edge features, where the condition uses one limit, set Param2 to M_NULL. To specify an edge selection based on edge features, where the condition uses two limits, set Param2 to the high condition limit.
To specify an edge selection based on the inter-relationship of edges, where SelectionCriterion is either set to a specific edge (M_SPECIFIC_EDGE), or to a group of edges (M_ALL_EDGES, M_EXCLUDED_EDGES, M_INCLUDED_EDGES), set Param2 to M_NULL.
To specify an edge selection based on the current status of edges, set Param2 to M_NULL.
To specify an edge selection based on the proximity of the edges to a point, set Param2 to the Y-coordinate of this point.
To crop and select a portion of a specified edge (M_CROP_CHAIN), set Param2 to the edgel index where to split the edge.
Header | Include mil.h. |
Library | Use mil.lib; miledge.lib. |
DLL | Requires mil.dll; miledge.dll. |