| Customize Help
| Save Settings

MedgeGetNeighbors



Function Map
Synopsis
Get edgels from an Edge Finder result buffer that are the closest neighbors to a list of user-specified point coordinates.
Syntax
void MedgeGetNeighbors(
MIL_ID EdgeResultId, //in
MIL_INT SizeOfArray, //in
const MIL_DOUBLE *SrcArrayXPtr, //in
const MIL_DOUBLE *SrcArrayYPtr, //in
const MIL_DOUBLE *SrcArrayAnglePtr, //in
MIL_DOUBLE *DstArrayXPtr, //out
MIL_DOUBLE *DstArrayYPtr, //out
MIL_INT *DstArrayIndexPtr, //out
MIL_INT *DstArrayLabelPtr, //out
MIL_INT64 ControlFlag //in
)
Description

This function retrieves the coordinates of edgels, from an Edge Finder result buffer, that correspond to the closest neighbors from a list of user-specified source point coordinates. You can also set a series of constraints that potential results must adhere to before being returned. To do so, use the appropriate settings in MedgeControl().

If your target image was associated with a camera calibration context but you want to retrieve positional and dimensional results in pixel units, use MedgeControl() with the M_RESULT_OUTPUT_UNITS control type set to M_PIXEL. Note that if you set M_RESULT_OUTPUT_UNITS to M_WORLD and the results were not obtained from a calibrated image, MedgeGetNeighbors() will generate an error. Additionally, if results were obtained from a calibrated source image, and you specify to retrieve results in world units, user-specified coordinates and constraints must be specified in the same world units as the coordinate system used to calculate the results.

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 from which to search for edgel candidates.

SizeOfArray

Specifies the number of points provided. This value represents how many user-specified point coordinates will be searched for in the Edge Finder result buffer.

When using a standard vector (std::vector) overload function in C++, you can pass M_DEFAULT to this parameter and MIL will automatically determine the size based on the number of items in the vector passed to the SrcArrayXPtr, SrcArrayYPtr, SrcArrayAnglePtr, DstArrayXPtr, DstArrayYPtr, DstArrayIndexPtr, or DstArrayLabelPtr parameter.

SrcArrayXPtr
Accepts the address of one of the following:
  • array of type MIL_DOUBLE [optionally, in C++: a reference to a constant std::vector<MIL_DOUBLE> ] (and a maximum array rank for C# of 1)
    Required array size:(SizeOfArray)

Specifies the address of the array containing the X-coordinate(s) of the source point(s).

SrcArrayYPtr
Accepts the address of one of the following:
  • array of type MIL_DOUBLE [optionally, in C++: a reference to a constant std::vector<MIL_DOUBLE> ] (and a maximum array rank for C# of 1)
    Required array size:(SizeOfArray)

Specifies the address of the array containing the Y-coordinate(s) of the source point(s).

SrcArrayAnglePtr
Accepts the address of one of the following:
  • array of type MIL_DOUBLE [optionally, in C++: a reference to a constant std::vector<MIL_DOUBLE> ] (and a maximum array rank for C# of 1)
    Required array size:(SizeOfArray)

Specifies the address of the array containing the constraint angle(s) used to refine the search for edgel candidates. Note that angle values (0° to 360°) are measured counter-clockwise and must be mapped between either 0 to 255 (for contour contexts) or 0 to 127 (for crest contexts).

If no value is required, set this parameter to M_NULL.

DstArrayXPtr
Accepts the address of one of the following:

Specifies the address of the array in which the X-coordinate(s) of the edgel(s) found in the Edge Finder result buffer are to be written. If no edgels were found, ignore the information written. Note that if no edgels were found, the index (DstArrayIndexPtr) and label (DstArrayLabelPtr) of the edgels is M_NULL.

The size of the array must be equal to SizeOfArray multiplied by the maximum number of edgel candidates for each point (M_NEIGHBOR_MAXIMUM_NUMBER).

If no value is required, set this parameter to M_NULL.

DstArrayYPtr
Accepts the address of one of the following:

Specifies the address of the array in which the Y-coordinate(s) of the edgel(s) found in the Edge Finder result buffer is to be written. If no edgels were found, ignore the information written. Note that if no edgels were found, the index (DstArrayIndexPtr) and label (DstArrayLabelPtr) of the edgels is M_NULL.

The size of the array must be equal to SizeOfArray multiplied by the maximum number of edgel candidates for each point (M_NEIGHBOR_MAXIMUM_NUMBER).

If no value is required, set this parameter to M_NULL.

DstArrayIndexPtr
Accepts the address of one of the following:

Specifies the address of the array in which the index of the edgel(s) found in the Edge Finder result buffer is to be written. If no edgels were found, M_NULL is written.

The size of the array must be equal to SizeOfArray multiplied by the maximum number of edgel candidates for each point (M_NEIGHBOR_MAXIMUM_NUMBER).

If no value is required, set this parameter to M_NULL.

DstArrayLabelPtr
Accepts the address of one of the following:

Specifies the address of the array in which the label of the edgel's edge found in the Edge Finder result buffer is to be written. If no edgels were found, M_NULL is written.

The size of the array must be equal to SizeOfArray multiplied by the maximum number of edgel candidates for each point (M_NEIGHBOR_MAXIMUM_NUMBER).

If no value is required, set this parameter to M_NULL.

ControlFlag

Specifies the accuracy with which to return edgels.

function map For specifying the accuracy
Click to summarizeValue Description
Click to summarize M_DEFAULT

Same as M_GET_EDGELS.

Click to summarize M_GET_EDGELS

Specifies that edgels are returned with normal accuracy. In this case, only edgels explicitly located in the Edge Finder result buffer can be returned.

(summarize)
Click to summarize M_GET_SUBEDGELS

Specifies that edgels are returned with high accuracy. In this case, a point between two edgels can be returned.

When using M_GET_SUBEDGELS, the M_NEIGHBOR_MAXIMUM_NUMBER constraint in MedgeControl() must be set to 1.

(summarize)
Compilation information
Header Include mil.h.
Library Use mil.lib; miledge.lib.
DLL Requires mil.dll; miledge.dll.
DEFAULT GET EDGELS GET SUBEDGELS