| Customize Help
| Save Settings

MedgePut



Function Map
Synopsis
Put edge chains from user-supplied arrays into an Edge Finder result buffer.
Syntax
void MedgePut(
MIL_ID ResultEdgeId, //in
MIL_INT NumEdgels, //in
const MIL_INT *ChainIndexArrayPtr, //in
const MIL_DOUBLE *PosXArrayPtr, //in
const MIL_DOUBLE *PosYArrayPtr, //in
const MIL_DOUBLE *AngleArrayPtr, //in
const MIL_DOUBLE *MagnitudeArrayPtr, //in
MIL_INT64 ControlFlag //in
)
Description

This function copies edge chains from user-supplied arrays to a specified Edge Finder result buffer. This can be useful if you want to construct an Edge Finder result buffer that cannot be obtained from one image. You can therefore combine results from multiple Edge Finder result buffers to, for example, build a complete model to add to a Model Finder context.

You must only add edge chains that respect the following constraints, whereby pixels are considered connected based on an 8-connected lattice:

  • Consecutive edgels must occupy separate connected pixels.

  • No branches are allowed (they start or end a separate chain).

  • There must not be an edge in the edge map that is more than 1 pixel wide. This means that the first and fourth edgel in the edge chain must not be in neighboring pixels.

All edge chains must be at the same scale and this scale must be the scale at which they were originally extracted. If edges were extracted at a different scale (MedgeControl() with M_EXTRACTION_SCALE), you must convert them to their original extraction scale.

If edgels are calculated with pixel accuracy, you must provide edgels with coordinates that are integer values; in this case, the distance between consecutive edgels should be one pixel. If edgels are calculated with subpixel accuracy, you can provide edgels with coordinates that are double values; in this case, the distance between consecutive edgels is such that, each pixel touched by the edge corresponds to one edgel. To change the accuracy edgels are calculated with, use MedgeControl() with M_ACCURACY.

To use an Edge Finder result buffer that contains edges set using MedgePut() with the Model Finder module, you must respect the following limitation. First, edges in the source image buffer must have been previously extracted and saved in the Edge Finder result buffer, using MedgeCalculate(). Second, the coordinates of the edge chains in the user-supplied arrays must not exceed the boundaries of the source image buffer. You can inquire the width and height of the source image buffer using MedgeGetResult() with M_SIZE_X and M_SIZE_Y.

The X- and Y-coordinates of the edgels you are adding to the Edge Finder result buffer must be provided in pixel units (as opposed to real-world values). If your current results have been calibrated, the coordinates added to those results will be automatically transformed to their appropriate real-world values. For more information, see the Working with real-world units section of Chapter 26: Calibrating your camera setup.

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
ResultEdgeId

Specifies the identifier of the Edge Finder result buffer in which to put user-supplied data.

NumEdgels

Specifies the number of edgels to add to 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 PosXArrayPtr or PosYArrayPtr parameter.

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

Specifies the address of the array containing the indices of the edgels' edges to add to the Edge Finder result buffer. If you do not want to provide this information, set this parameter to M_NULL. In this case, only one edge will be added.

PosXArrayPtr
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:(NumEdgels)

Specifies the address of the array containing the X-coordinate(s) of the edgel(s) to add to the Edge Finder result buffer.

PosYArrayPtr
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:(NumEdgels)

Specifies the address of the array containing the Y-coordinate(s) of the edgel(s) to add to the Edge Finder result buffer.

AngleArrayPtr
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:(NumEdgels)

Specifies the address of the array containing the orientation of the edgel(s) to add to the Edge Finder result buffer. If you do not want to provide this information, set this parameter to M_NULL.

Angle values must be mapped in the range of 0 to 255. That is, 0° corresponds to 0, and 360° corresponds to 256.

MagnitudeArrayPtr
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:(NumEdgels)

Specifies the address of the array containing the magnitude of the edgel(s) to add to the Edge Finder result buffer. If you do not want to provide this information, set this parameter to M_NULL.

ControlFlag

Reserved for future expansion and must be set to M_DEFAULT.

Compilation information
Header Include mil.h.
Library Use mil.lib; miledge.lib.
DLL Requires mil.dll; miledge.dll.