| Customize Help
| Save Settings

MedgeSelect



Function Map
Synopsis
Select edges for calculations and result retrieval.
Syntax
void MedgeSelect(
MIL_ID EdgeResultId, //in
MIL_INT64 Operation, //in
MIL_INT64 SelectionCriterion, //in
MIL_INT64 Condition, //in
MIL_DOUBLE Param1, //in
MIL_DOUBLE Param2 //in
)
Description

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 the status of 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 9: Edge Finder and the Advanced edge extraction section of Chapter 9: Edge Finder.

Note that this function reference has not been updated for a MIL system added during a MIL update. Refer to the MIL system's release note to see which MIL system’s documentation you should use in its place and any possible differences.
Parameters
This function is not supported on the selected boards.
This function reference has not been updated for the selected MIL system. To show the content of this page, choose a second MIL system; refer to the MIL system's release note to see which MIL system’s documentation to choose and any possible differences.
Parameters
EdgeResultId

Specifies the identifier of the Edge Finder result buffer to be used in the edge selection process.

See the Parameter associations section for possible values that can be specified.

Operation

Specifies the operation to perform on the specified edges. Set this parameter to one of the following values.

function map For specifying the operation
Click to summarizeValue Description
Click to summarize M_DELETE

Deletes edges that meet the specified condition. M_DELETE affects only included edges, unless otherwise stated by the SelectionCriterion parameter.

M_DELETE removes edges permanently from the Edge Finder result buffer and, consequently, prevents these edges from being re-included.

(summarize)
Click to summarize M_EXCLUDE

Excludes all edges that meet the specified condition.

M_EXCLUDE affects only the status of currently included edges.

(summarize)
Click to summarize M_EXCLUDE_ONLY

Excludes only those edges that meet the specified condition and includes all others.

The exclusion does not consider the present status of edges (whether they are excluded), except for edges that have been deleted (M_DELETE), unless otherwise stated by the SelectionCriterion parameter.

(summarize)
Click to summarize M_INCLUDE

Includes all edges that meet the specified condition.

M_INCLUDE affects only the status of currently excluded edges.

(summarize)
Click to summarize M_INCLUDE_ONLY

Includes only those edges that meet the specified condition and excludes all others.

The inclusion does not consider the present status of edges (whether they are included), except for edges that have been deleted (M_DELETE), unless otherwise stated by the SelectionCriterion parameter.

(summarize)
SelectionCriterion

Specifies on what the selection criterion will be based. Note that for an edge selection based on the proximity of the edges to a point, this parameter must be set to M_NULL.

See the Parameter associations section for possible values that can be specified.

Condition

Specifies the condition for the edge selection. Note that for an edge selection based on the current status of edges, this parameter must be set to M_NULL.

See the Parameter associations section for possible values that can be specified.

Param1

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.

See the Parameter associations section for possible values that can be specified.

Param2

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.

See the Parameter associations section for possible values that can be specified.

The table below lists possible values for the EdgeResultId, SelectionCriterion, Condition, Param1, and Param2 parameters.

function map For specifying the edge selection method
Click to summarizeEdgeResultId Description
SelectionCriterion
Condition
Param1
Param2
Click to summarize Edge Finder result buffer identifier for a
chain cropping based edge selection

Specifies an Edge Finder result buffer on which to perform a chain cropping edge selection. This type of selection essentially splits off a portion of a single specified edge, assigns the portion a new edge label, and selects the portion for inclusion, exclusion, or deletion from future operations on the result buffer. The other portion keeps its current edge label value and status. The two portions are considered two touching edges after the split. Therefore, all their calculated edge features are updated after the split.

The specified edgel index value is the dividing point.

(summarize)
Click to summarize SelectionCriterion

Sets the selection criterion.

(summarize)
Click to summarize M_CROP_CHAIN

Specifies a chain cropping edge selection.

Click to summarize Condition

Sets the condition that an edgel index value must satisfy to be part of the new edge that is selected.

(summarize)
Click to summarize M_GREATER

Specifies that the edgels with an index value greater than the specified edgel index value are considered part of the new edge.

Click to summarize M_GREATER_OR_EQUAL

Specifies that the edgels with an index value greater than or equal to the specified edgel index value are considered part of the new edge.

Click to summarize M_LESS

Specifies that the edgels with an index value less than the specified edgel index value are considered part of the new edge.

Click to summarize M_LESS_OR_EQUAL

Specifies that the edgels with an index value less than or equal to the specified edgel index value are considered part of the new edge.

Click to summarize Param1

Sets the label value of the edge to crop.

Click to summarize Param2

Sets the edgel index value indicating where to split the edge.

Click to summarize Edge Finder result buffer identifier for a
feature based edge selection

Specifies an Edge Finder result buffer on which to perform an edge selection based on a calculated edge feature. Edges whose specified feature satisfies the condition are included, excluded, or deleted from future operations on the Edge Finder result buffer.

(summarize)
Click to summarize SelectionCriterion

Sets the calculated edge feature to use as the selection criterion. The result buffer must already contain the results for the specified feature. Otherwise, an error wll occur.

(summarize)
Click to summarize M_AVERAGE_STRENGTH

Uses the average strength . INFO

Click to summarize M_BOX_X_MAX

Uses the extreme right edgel coordinate .

Click to summarize M_BOX_X_MIN

Uses the extreme left edgel coordinate .

Click to summarize M_BOX_Y_MAX

Uses the extreme bottom edgel coordinate .

Click to summarize M_BOX_Y_MIN

Uses the extreme top edgel coordinate .

Click to summarize M_CENTER_OF_GRAVITY_X

Uses the X-position of the center of gravity. INFO

Click to summarize M_CENTER_OF_GRAVITY_Y

Uses the Y-position of the center of gravity. INFO

Click to summarize M_CIRCLE_FIT_CENTER_X

Uses the X-coordinate of the center of the circle that is the best fit .

Click to summarize M_CIRCLE_FIT_CENTER_Y

Uses the Y-coordinate of the center of the circle that is the best fit .

Click to summarize M_CIRCLE_FIT_COVERAGE

Uses the coverage of the circle that is the best fit . INFO

Click to summarize M_CIRCLE_FIT_ERROR

Uses the fit error of the circle that is the best fit . INFO

Click to summarize M_CIRCLE_FIT_RADIUS

Uses the radius of the circle that is the best fit .

Click to summarize M_CLOSURE

Uses the closure state . INFO

Click to summarize M_CONVEX_PERIMETER

Uses the convex elongation . INFO

Click to summarize M_ELLIPSE_FIT_ANGLE

Uses the angle of the ellipse that is the best fit .

Click to summarize M_ELLIPSE_FIT_CENTER_X

Uses the X-coordinate of the center of the ellipse that is the best fit .

Click to summarize M_ELLIPSE_FIT_CENTER_Y

Uses the Y-coordinate of the center of the ellipse that is the best fit .

Click to summarize M_ELLIPSE_FIT_COVERAGE

Uses the coverage of the ellipse that is the best fit . INFO

Click to summarize M_ELLIPSE_FIT_ERROR

Uses the fit error of the ellipse that is the best fit . INFO

Click to summarize M_ELLIPSE_FIT_MAJOR_AXIS

Uses the major axis of the ellipse that is the best fit . INFO

Click to summarize M_ELLIPSE_FIT_MINOR_AXIS

Uses the minor axis of the ellipse that is the best fit . INFO

Click to summarize M_FAST_LENGTH

Uses a coarse approximation for the length . INFO

Click to summarize M_FERET_ELONGATION

Uses the Feret elongation . INFO

Click to summarize M_FERET_GENERAL

Uses the general Feret . INFO

Click to summarize M_FERET_MAX_ANGLE

Uses the maximum Feret angle . INFO

Click to summarize M_FERET_MAX_DIAMETER

Uses the maximum Feret diameter . INFO

Click to summarize M_FERET_MEAN_DIAMETER

Uses the average Feret diameter at all the angles checked. INFO

Click to summarize M_FERET_MIN_ANGLE

Uses the minimum Feret angle . INFO

Click to summarize M_FERET_MIN_DIAMETER

Uses the minimum Feret diameter . INFO

Click to summarize M_FERET_X

Uses the X-Feret value . INFO

Click to summarize M_FERET_Y

Uses the Y-Feret value . INFO

Click to summarize M_FIRST_POINT_X

Uses the X-coordinate of the first point . INFO

Click to summarize M_FIRST_POINT_Y

Uses the Y-coordinate of the first point . INFO

Click to summarize M_LABEL_VALUE

Uses the label value of each edge . INFO

Click to summarize M_LENGTH

Uses the length . INFO

Click to summarize M_LINE_FIT_A

Uses the coefficient A of the line that is the best fit . INFO

Click to summarize M_LINE_FIT_B

Uses the coefficient B of the line that is the best fit . INFO

Click to summarize M_LINE_FIT_C

Uses the coefficient C of the line that is the best fit . INFO

Click to summarize M_LINE_FIT_ERROR

Uses the fit error of the line that is the best fit . INFO

Click to summarize M_MOMENT_ELONGATION

Uses the moment elongation . INFO

Click to summarize M_POSITION_X

Uses the X-position . INFO

Click to summarize M_POSITION_Y

Uses the Y-position . INFO

Click to summarize M_SIZE

Uses the number of edgels .

Click to summarize M_STRENGTH

Uses the strength . INFO

Click to summarize M_TORTUOSITY

Uses the tortuosity measure . INFO

Click to summarize M_X_MAX_AT_Y_MAX

Uses the maximum X-coordinate at the maximum Y-coordinate . INFO

Click to summarize M_X_MIN_AT_Y_MIN

Uses the minimum X-coordinate at the minimum Y-coordinate . INFO

Click to summarize M_Y_MAX_AT_X_MIN

Uses the maximum Y-coordinate at the minimum X-coordinate . INFO

Click to summarize M_Y_MIN_AT_X_MAX

Uses the minimum Y-coordinate at the maximum X-coordinate . INFO

Click to summarize Condition

Sets the edge selection condition.

(summarize)
Click to summarize 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.

Click to summarize M_GREATER

Specifies that edges with values for the specified feature greater than Param1 are included, excluded, or deleted from future operations on the specified Edge Finder result buffer.

Click to summarize M_GREATER_OR_EQUAL

Specifies that edges with values for the specified feature greater than or equal to Param1 are included, excluded, or deleted from future operations on the specified Edge Finder result buffer.

Click to summarize M_IN_RANGE

Specifies that edges with values for the specified feature in the range of Param1 to Param2, inclusive, are included, excluded, or deleted from future operations on the specified Edge Finder result buffer.

Click to summarize M_LESS

Specifies that edges with values for the specified feature less than Param1 are included, excluded, or deleted from future operations on the specified Edge Finder result buffer.

Click to summarize M_LESS_OR_EQUAL

Specifies that edges with values for the specified feature less than or equal to Param1 *are included, excluded, or deleted from future operations on the specified Edge Finder result buffer.

Click to summarize 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.

Click to summarize 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.

Click to summarize Param1

Sets a condition limit. If the condition uses one limit, set this parameter to the required condition limit. If the condition uses two limits, set this parameter to the low condition limit.

(summarize)
Click to summarize Param2

Sets the high condition limit. If the condition uses one limit, set this parameter to M_NULL. If the condition uses two limits, set this parameter to the high condition limit.

(summarize)
Click to summarize M_NULL

Specifies that this parameter is unused.

Click to summarize Value

Specifies the high condition limit.

Click to summarize Edge Finder result buffer identifier for an
inter-relationship based edge selection

Specifies an Edge Finder result buffer on which to perform an edge selection based on the inter-relationship of edges. Edges that fall inside or outside of a boundary defined by other edges are included, excluded, or deleted from future operations on the Edge Finder result buffer. The specified condition establishes whether edges inside or outside are selected. You specify the delimiting edges; to define the boundary, you can specify to use the edges as is or to use their bounding box as a delimiter.

(summarize)
Click to summarize SelectionCriterion

Sets which edges are used to delimit the boundary.

(summarize)
Click to summarize M_ALL_EDGES

Specifies all edges regardless of their present status, except for edges that have been deleted.

Click to summarize M_EXCLUDED_EDGES

Specifies all currently excluded edges, except for edges that have been deleted.

Click to summarize M_INCLUDED_EDGES

Specifies all currently included edges.

Click to summarize M_SPECIFIC_EDGE

Specifies a specific edge. Use Param1 to set the label value of the edge.

(summarize)
Click to summarize Condition

Sets the edge selection condition based on the relationship to the specified delimiting edge(s).

(summarize)
Click to summarize M_INSIDE_BOX

Specifies that edges inside the bounding box of the specified edge, or inside any individual bounding box of the specified group of edges, are included, excluded, or deleted from future operations on the specified Edge Finder result buffer.

Click to summarize M_INSIDE_CHAIN

Specifies that edges inside the chain of the specified edge, or inside any individual chain of the specified group of edges, are included, excluded, or deleted from future operations on the specified Edge Finder result buffer.

Note that no edges are selected from a delimiting edge that is not closed. For more information, see M_CLOSURE in MedgeControl(). Also, if an edge is not completely enclosed by a closed edge, it is considered as an outside or equal edge.

(summarize)
Click to summarize M_INSIDE_OR_EQUAL_BOX

Specifies that edges inside or equal to the bounding box of the specified edge, or inside or equal to any individual bounding box of the specified group of edges, are included, excluded, or deleted from future operations on the specified Edge Finder result buffer.

Click to summarize M_INSIDE_OR_EQUAL_CHAIN

Specifies that edges inside or equal to the chain of the specified edge, or inside or equal to any individual chain of the specified group of edges, are included, excluded, or deleted from future operations on the specified Edge Finder result buffer.

Note that no edges are selected from a delimiting edge that is not closed. For more information, see M_CLOSURE in MedgeControl(). Also, if an edge is not completely enclosed by a closed edge, it is considered as an outside or equal edge.

(summarize)
Click to summarize M_OUTSIDE_BOX

Specifies that edges outside the bounding box of the specified edge, or outside any individual bounding box of the specified group of egdes, are included, excluded, or deleted from future operations on the specified Edge Finder result buffer.

Click to summarize M_OUTSIDE_CHAIN

Specifies that edges outside the chain of the specified edge, or outside any individual chain of the specified group of edges, are included, excluded, or deleted from future operations on the specified Edge Finder result buffer.

Note that no edges are selected from a delimiting edge that is not closed. For more information, see M_CLOSURE in MedgeControl(). Also, if an edge is not completely enclosed by a closed edge, it is considered as an outside or equal edge.

(summarize)
Click to summarize M_OUTSIDE_OR_EQUAL_BOX

Specifies that edges outside or equal to the bounding box of the specified edge, or outside or equal to any individual bounding box of the specified group of edges, are included, excluded, or deleted from future operations on the specified Edge Finder result buffer.

Click to summarize M_OUTSIDE_OR_EQUAL_CHAIN

Specifies that edges outside or equal to the chain of the specified edge, or outside or equal to any individual chain of the specified group of edges, are included, excluded, or deleted from future operations on the specified Edge Finder result buffer.

Note that no edges are selected from a delimiting edge that is not closed. For more information, see M_CLOSURE in MedgeControl(). Also, if an edge is not completely enclosed by a closed edge, it is considered as an outside or equal edge.

(summarize)
Click to summarize Param1

Sets the label value of the edge to use to delimit the boundary, when delimiting the boundary using only one edge.

(summarize)
Click to summarize M_NULL

Specifies that this parameter is unused (when using a group of edges to delimit the boundary).

Click to summarize Value

Specifies the label of the edge.

Click to summarize Param2

This parameter must be set to M_NULL.

(summarize)
Click to summarize Edge Finder result buffer identifier for a
proximity based edge selection

Specifies an Edge Finder result buffer on which to perform an edge selection based on the proximity of an edge, or edges, to a specified point.

(summarize)
Click to summarize SelectionCriterion

This parameter must be set to M_NULL.

(summarize)
Click to summarize Condition

Sets the edge selection condition based on proximity.

(summarize)
Click to summarize M_ALL_NEAREST_NEIGHBORS

Specifies that all edges within the specified radius from the stated point are included, excluded, or deleted from future operations on the specified Edge Finder result buffer.

Define the search radius using MedgeControl() with M_NEAREST_NEIGHBOR_RADIUS.

(summarize)
Click to summarize M_NEAREST_NEIGHBOR

Specifies that the closest edge from the specified point is included, excluded, or deleted from future operations on the specified Edge Finder result buffer.

You can use MedgeControl() with M_NEAREST_NEIGHBOR_RADIUS to specify a circular area (around the specified point) in which to find the closest edge. If an edge is totally outside the search radius, it will not be considered as the closest edge. If some part of the edge chain lies within the search radius, it will be considered as a neighbor.

(summarize)
Click to summarize Param1

Sets the X-coordinate of the point (pixel or world units).

Click to summarize Param2

Sets the Y-coordinate of the point (pixel or world units).

Click to summarize Edge Finder result buffer identifier for a
status based edge selection

Specifies an Edge Finder result buffer on which to perform an edge selection based on the current status (included or excluded) of edges.

(summarize)
Click to summarize SelectionCriterion

Sets the edge status to use as the selection criterion.

(summarize)
Click to summarize M_ALL_EDGES

Specifies to select all edges regardless of their present status, except for edges that have been deleted.

Click to summarize M_EXCLUDED_EDGES

Specifies to select all currently excluded edges, except for edges that have been deleted.

Click to summarize M_INCLUDED_EDGES

Specifies to select all currently included edges.

Click to summarize Condition

This parameter must be set to M_NULL.

(summarize)
Click to summarize Param1

This parameter must be set to M_NULL.

(summarize)
Click to summarize Param2

This parameter must be set to M_NULL.

(summarize)
Compilation information
Header Include mil.h.
Library Use mil.lib; miledge.lib.
DLL Requires mil.dll; miledge.dll.
DELETE EXCLUDE EXCLUDE ONLY INCLUDE INCLUDE ONLY CROP CHAIN GREATER GREATER OR EQUAL LESS LESS OR EQUAL AVERAGE STRENGTH BOX X MAX BOX X MIN BOX Y MAX BOX Y MIN CENTER OF GRAVITY X CENTER OF GRAVITY Y CIRCLE FIT CENTER X CIRCLE FIT CENTER Y CIRCLE FIT COVERAGE CIRCLE FIT ERROR CIRCLE FIT RADIUS CLOSURE CONVEX PERIMETER ELLIPSE FIT ANGLE ELLIPSE FIT CENTER X ELLIPSE FIT CENTER Y ELLIPSE FIT COVERAGE ELLIPSE FIT ERROR ELLIPSE FIT MAJOR AXIS ELLIPSE FIT MINOR AXIS FAST LENGTH FERET ELONGATION FERET GENERAL FERET MAX ANGLE FERET MAX DIAMETER FERET MEAN DIAMETER FERET MIN ANGLE FERET MIN DIAMETER FERET X FERET Y FIRST POINT X FIRST POINT Y LABEL VALUE LENGTH LINE FIT A LINE FIT B LINE FIT C LINE FIT ERROR MOMENT ELONGATION POSITION X POSITION Y SIZE STRENGTH TORTUOSITY X MAX AT Y MAX X MIN AT Y MIN Y MAX AT X MIN Y MIN AT X MAX EQUAL GREATER GREATER OR EQUAL IN RANGE LESS LESS OR EQUAL NOT EQUAL OUT RANGE NULL ALL EDGES EXCLUDED EDGES INCLUDED EDGES SPECIFIC EDGE INSIDE BOX INSIDE CHAIN INSIDE OR EQUAL BOX INSIDE OR EQUAL CHAIN OUTSIDE BOX OUTSIDE CHAIN OUTSIDE OR EQUAL BOX OUTSIDE OR EQUAL CHAIN NULL NULL NULL ALL NEAREST NEIGHBORS NEAREST NEIGHBOR ALL EDGES EXCLUDED EDGES INCLUDED EDGES NULL NULL NULL