| MIL 10 Reference
| Customize Help
| Save Settings

M3dmapDraw



See also
Availability
Not available in MIL-Lite
Available in MIL

Available on Windows
Available on Linux

Partially supported on:
Partially supported on Matrox Radient eCL
Partially supported on Matrox Radient eV-CXP
Partially supported on Matrox Solios eA/XA
Partially supported on Matrox Solios ecl/xcl/ev-cl

Fully supported on:
Fully supported on Host system
Fully supported on Matrox CronosPlus
Fully supported on Matrox GPU processing driver
Fully supported on Matrox GigE Vision driver
Fully supported on Matrox IEEE 1394 IIDC driver
Fully supported on Matrox Iris GT
Fully supported on Matrox Morphis
Fully supported on Matrox Morphis QxT
Fully supported on Matrox Orion HD
Fully supported on Matrox USB3 Vision driver (requires Update 19)
Fully supported on Matrox Vio

For any information regarding a MIL system added during a MIL Update, see the MIL system’s release note

Available on Non-Matrox computer
Available on Matrox 4Sight-X
Available on Matrox 4Sight GP
Available on Matrox Supersight
function map Function map
Examples
Synopsis
Generate an image from a 3D reconstruction geometry object, context, or result buffer.
Syntax
void M3dmapDraw(
MIL_ID ContextGraId, //in
MIL_ID M3dmapId, //in
MIL_ID DstImageBufOrListGraId, //in
MIL_INT64 Operation, //in
MIL_INT LabelOrIndex, //in
MIL_INT64 ControlFlag //in
)
Description

This function draws specific features of a 3D reconstruction geometry object, context, or result buffer.

Unlike most other functions that modify a MIL object, you can call this function concurrently from multiple threads on the same M_POINT_CLOUD_CONTAINER result buffer (M3dmapId) without using a M_MUTEX object. This is valid as long as the LabelOrIndex parameter of the concurrent calls is set to a different index.

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
ContextGraId

Specifies the identifier of the graphics context to use. This parameter must be set to one of the following values:

function map For specifying the graphics context
CollapseValue Description
Collapse M_DEFAULT

Specifies that the default graphics context of the current MIL application is used.

Note that there is a different default graphics context for each thread.

(summarize)
Collapse MIL graphics context identifier

Specifies a valid graphics context identifier, which you have allocated using MgraAlloc().

M3dmapId

Specifies the identifier of a 3D reconstruction geometry object, context, or result buffer.

If you specify a 3D reconstruction geometry object, it must have been previously allocated on the required system using M3dmapAlloc() and must have been successfully defined using M3dmapSetGeometry().

If you specify a 3D reconstruction context, it must have been previously allocated on the required system using M3dmapAlloc() and must have been successfully calibrated using M3dmapCalibrate().

If you specify a 3D reconstruction result buffer, it must have been previously allocated on the required system using M3dmapAllocResult(), and M3dmapAddScan() must have been called at least once on the result buffer.

[Matrox Radient eCL; Matrox Radient eV-CL (requires Update 27); Matrox Radient eV-CLHS (requires Update 21); Matrox Radient eV-CXP; Matrox RadientPro-CL (requires Update 7); Matrox Solios eA/XA; Matrox Solios ecl/xcl/ev-cl]

The 3D reconstruction geometry object, context, or result buffer must be allocated on the same system as the graphics context (ContextGraId). If it is not, an error will occur.

DstImageBufOrListGraId

Specifies the identifier of the destination image buffer or graphics list in which to draw.

If you specify an image buffer, it must be 1-band, and in the case of M_DRAW_GEOMETRY, must be an 8-bit or 16-bit unsigned buffer and must be 3D-corrected. This image buffer must not have a region of interest (ROI) associated with it. Using an image buffer with an ROI will cause an error.

If you specify a graphics list, the graphics list must have been previously allocated using MgraAllocList(). A graphics list can only be used as a destination for certain operations.

For any operation on a 3D reconstruction context or result buffer, you can establish the minimum size with which to allocate the destination buffer, using M3dmapInquire() or M3dmapGetResult() with M_CAMERA_IMAGE_SIZE_X and M_CAMERA_IMAGE_SIZE_Y.

Operation

Specifies what to draw in the destination image buffer or graphics list.

The following operations can only draw in a destination image buffer.

function map For specifying the type of operation to perform
CollapseValue Description
Collapse M_DRAW_GEOMETRY

Generates the depth map representing the specified geometry object. The geometry object must have been successfully defined using M3dmapSetGeometry().

An analytic geometry object's domain is theoretically infinite; therefore, to define the region in space where you are interested in visualizing the geometry object, the destination buffer's size and calibration information is used to establish a bounding box. The destination buffer must have a constant pixel size in X and Y and have a valid Z-scale.

If the geomery object has been defined from another fully corrected depth map buffer, and you want to draw the annotation in the same area of space, you can copy the calibration information from the depth map buffer to the destination buffer using MbufCopy() prior to calling M3dmapDraw().

Note that saturation can occur, depending on the Z-scale and offset of the destination buffer. If, for a given pixel of the destination buffer, the corresponding Z-value of the geometry object falls outside the buffer's range of Z-values, the pixel will be saturated to either 0 or the buffer's maximum value, minus one (the maximum value is reserved to represent missing data).

This drawing operation is only available if M3dmapId is a geometry object.

(summarize)
Collapse M_DRAW_PEAKS_LAST

Draws the laser line that would have produced the most recent results stored in the 3D reconstruction result buffer using M3dmapAddScan().

This drawing operation is only available if M3dmapId is a 3D reconstruction result buffer, allocated using M3dmapAllocResult().

Note that since only 1-band destination buffers are supported, the foreground color of the specified graphic context must be grayscale.

(summarize)
Collapse M_DRAW_REGION_INTERPOLATED

Draws all regions (pixels) of the laser line image that were interpolated due to missing data (gaps) in the calibration laser lines. Although the laser line can appear in these regions and be associated with a valid height, the heights will be less accurate since they are interpolated.

This drawing operation is only available if M3dmapId is a 3D reconstruction context allocated with M_DEPTH_CORRECTION and calibrated using M3dmapCalibrate().

(summarize)
Collapse M_DRAW_REGION_INVERTED

Draws all regions (pixels) of the laser line image where an inversion occured. An inversion occurs when a reference plane associated with a lower height is found above a reference plane associated with a higher height. The laser line can still appear in these regions, however, results taken from these regions will be incorrect.

This drawing operation is only available if M3dmapId is a 3D reconstruction context allocated with M_DEPTH_CORRECTION and calibrated using M3dmapCalibrate().

(summarize)
Collapse M_DRAW_REGION_MISSING_DATA

Draws all regions (pixels) of the laser line image where the laser line cannot appear, because of missing data (gaps) in the calibration laser lines that could not be accounted for by interpolation.

This drawing operation is only available if M3dmapId is a 3D reconstruction context allocated with M_DEPTH_CORRECTION and calibrated using M3dmapCalibrate().

(summarize)
Collapse M_DRAW_REGION_UNCALIBRATED

Draws all regions (pixels) of the laser line image where the laser line cannot appear, because they are outside the calibrated region.

This drawing operation is only available if M3dmapId is a 3D reconstruction context allocated with M_DEPTH_CORRECTION and calibrated using M3dmapCalibrate().

(summarize)
Collapse M_DRAW_REGION_VALID

Draws all regions (pixels) of the laser line image where the laser line can appear and be associated with a valid height.

This drawing operation is only available if M3dmapId is a 3D reconstruction context allocated with M_DEPTH_CORRECTION and calibrated using M3dmapCalibrate().

(summarize)

The following operations can draw in a destination image buffer or a graphics list.

function map For specifying an operation that can draw in a graphics list
CollapseValue Description
Collapse M_DRAW_CALIBRATION_LINES

Draws all the fitted laser lines used for calibrating the 3D reconstruction setup.

This drawing operation is only available if M3dmapId is a 3D reconstruction context allocated with M_CALIBRATED_CAMERA_LINEAR_MOTION and calibrated using M3dmapCalibrate().

(summarize)
Collapse M_DRAW_CALIBRATION_PEAKS

Draws all the extracted laser lines used for calibrating the 3D reconstruction setup.

This drawing operation is only available if M3dmapId is a 3D reconstruction context allocated with M_CALIBRATED_CAMERA_LINEAR_MOTION and calibrated using M3dmapCalibrate().

If drawing in an image buffer, the graphics context cannot have any zoom factors associated with it (MgraControl() with M_DRAW_ZOOM_X or M_DRAW_ZOOM_Y must be set to 1.0).

(summarize)
LabelOrIndex

Reserved for future expansion and must be set to M_DEFAULT.

ControlFlag

Reserved for future expansion and must be set to M_DEFAULT.

Compilation information
Header Include mil.h.
Library Use mil.lib; mil3dmap.lib.
DLL Requires mil.dll; mil3dmap.dll.
DEFAULT PROC NONE UNSIGNED TRUE PROC NONE DRAW GEOMETRY DRAW PEAKS LAST DRAW REGION INTERPOLATED DRAW REGION INVERTED DRAW REGION MISSING DATA DRAW REGION UNCALIBRATED DRAW REGION VALID DRAW CALIBRATION LINES DRAW CALIBRATION PEAKS