| MIL 10 Reference
| Customize Help
| Save Settings

M3dmapPut



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

Available on Windows
Available on Linux

Available on Non-Matrox computer
Available on Matrox 4Sight-X
Available on Matrox 4Sight GP
Available on Matrox Supersight
function map Function map
Examples
None.
Synopsis
Store world points inside an unorganized point cloud.
Syntax
void M3dmapPut(
MIL_ID Result3dmapId, //in
MIL_INT LabelOrIndex, //in
MIL_INT64 Feature, //in
MIL_INT64 Type, //in
MIL_INT ArraySize, //in
const void *Coord1OrPackedArrayPtr, //in
const void *Coord2ArrayPtr, //in
const void *Coord3ArrayPtr, //in
MIL_ID CalibratedMilObjectId, //in
MIL_INT64 ControlFlag //in
)
Description

This function creates a new point cloud or repopulates an existing point cloud. This function is used as an alternative to M3dmapAddScan(), typically with points generated using third-party hardware or software. This function cannot add additional points to an existing point cloud; rather, it deletes the existing points and adds new points to the original point cloud. While it cannot add additional points to a point cloud, the function can affect point features, such as intensity, of an existing point cloud. The function can add point features, delete point features, and write over point features associated with points in the point cloud.

All point clouds created with or repopulated with M3dmapPut() are of type M_UNORGANIZED. If an existing point cloud is specified that is not of type M_UNORGANIZED (such as point clouds of type M_LASER_SCAN), an error occurs.

If you specify an array with one sort of point feature (position or intensity) and you specify an unorganized point cloud that already exists, you overwrite the same point feature of each existing point, but keep the remaining features of each point. For instance, if Feature is set to M_POSITION, and you specify an existing point cloud that has both position and intensity data, you will overwrite the existing position data of each point, but will keep the existing intensity data of each point. When overwriting intensity data, you keep the existing position data intact.

All points in a point cloud populated using M3dmapPut() are assumed to be in the absolute coordinate system, unless a relative coordinate system is specified using CalibratedMilObjectId.

When you are overwriting existing points with new points, you must put the same number of points as existed in the previous point cloud. If necessary, the array you specify with the new points should include any invalid points as place holders. This keeps the total number of places the same. It is also possible that, when creating a new point cloud, you want to store the invalid points in your array (for instance, to maintain the structure of how your points are internally represented). When adding points to a point cloud, whether creating a new point cloud or overwriting existing points, invalid points are generally represented with an X-, Y-, and Z-coordinate set to M_INVALID_POINT. How to specify an invalid point can differ, depending on the data type of your data. Note that it is possible that a feature, such as M_INTENSITY, has a valid value, while the point to which it corresponds is an invalid point with M_INVALID_POINT coordinates. In this case, you typically set the corresponding feature value to 0.

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 (Result3dmapId) 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 if there is complementary information.
Parameters
This function is not supported on the selected boards.
Parameters
Result3dmapId

Specifies the identifier of the 3D reconstruction result buffer in which to store the points. The 3D reconstruction result buffer must have been allocated on the required system using M3dmapAllocResult() with M_POINT_CLOUD_CONTAINER.

LabelOrIndex

Specifies the label or index of the point cloud in which to add or replace point data.

function map For specifying the label or index of a point cloud
CollapseValue Description
Collapse

Specifies the index of an existing point cloud in the specified 3D reconstruction result buffer. When you specify an index, you modify the data associated with each point in the point cloud, or you associate the points with new data.

You cannot create a new point cloud by specifying an index, and once a point cloud is created, you cannot add new points to the point cloud.

(summarize)
Parameters

Specifies the index of an existing point cloud.

Collapse

Specifies the label of a point cloud in the specified 3D reconstruction result buffer. When you specify the label of an existing point cloud, you modify the data associated with each point in the point cloud, or you associate the points with new data.

To create a new unorganized point cloud, specify a label that currently does not exist in the specified point cloud result buffer. In addition, specify the points to add to the point cloud. Note that once created, you cannot add new points to the point cloud.

(summarize)
Parameters

Specifies the label of a point cloud.

1 <= Value <= 134217727

Specifies the label as a unique positive integer value.

Feature

Specifies the type of data (position or intensity) to overwrite/add to the point cloud.

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

Type

Specifies a combination of two values: the data type and depth of the data in the arrays.

When you are deleting feature data, such as the intensity, you must set this parameter to M_DEFAULT.

Specify one of the following:

function map For specifying the depth and data type of the elements in the array
CollapseValue Description
Collapse M_FLOAT + 32

Specifies that the data in each element of the arrays is a 32-bit floating-point number.

Collapse M_FLOAT + 64

Specifies that the data in each element of the arrays is a 64-bit floating-point number.

Collapse M_UNSIGNED + 8

Specifies that the data in each element of the arrays is an 8-bit unsigned integer.

Collapse M_UNSIGNED + 16

Specifies that the data in each element of the arrays is an 16-bit unsigned integer.

ArraySize

Specifies the number of elements in each specified array.

function map For specifying the size of specified arrays
CollapseValue Description
Collapse M_NULL

Specifies that no arrays are specified.

When this parameter is set to M_NULL, the array parameters are set to M_NULL, and Feature is set to M_INTENSITY, you delete all the intensities in the specified point cloud. The X-, Y-, and Z-coordinates of the points in the point cloud are not changed.

(summarize)
Collapse Value > 0

Specifies the size of the specified arrays.

Coord1OrPackedArrayPtr
Accepts the address of one of the following (see the Parameter associations section for specifics on which is expected):
  • array of type MIL_DOUBLE
  • array of type MIL_FLOAT
  • array of type MIL_UINT16
  • array of type MIL_UINT8

Specifies the address of an array containing the X-coordinates or the intensities of the points, or a packed array containing all the data of the points.

The specified array must be the exact size it needs to be; otherwise an error is reported. The exact size is determined based on the number of points in the point cloud and the feature you are adding.

If you are deleting intensity data from an existing point cloud, set this parameter to M_NULL.

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

Coord2ArrayPtr
Accepts the address of one of the following (see the Parameter associations section for specifics on which is expected):
  • array of type MIL_DOUBLE
  • array of type MIL_FLOAT
  • array of type MIL_UINT16
  • array of type MIL_UINT8

Specifies the address of an array containing the Y-coordinates of the points.

If you are deleting intensity data from an existing point cloud, or this parameter is not being used, set this parameter to M_NULL.

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

Coord3ArrayPtr
Accepts the address of one of the following (see the Parameter associations section for specifics on which is expected):
  • array of type MIL_DOUBLE
  • array of type MIL_FLOAT
  • array of type MIL_UINT16
  • array of type MIL_UINT8

Specifies the address of an array containing the Z-coordinates of the points.

If you are deleting intensity data from an existing point cloud, or this parameter is not being used, set this parameter to M_NULL.

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

CalibratedMilObjectId

Specifies a calibrated MIL object (McalAlloc() set to M_3D_ROBOTICS or M_TSAI_BASED) whose relative coordinate system is used to express the given 3D points. Typically, calibrations are associated with images and digitizers; however, many other MIL objects can also be associated with calibrations. For more on how calibration information is stored and associated with other MIL objects, see the Propagating calibration information after performing a geometric operation section of Chapter 25: Calibrating your camera setup.

If CalibratedMilObjectId is set to M_NULL, the relative coordinate system is considered to be the same as the absolute coordinate system.

If you are not adding or modifying position data, that is, if Feature is set to M_INTENSITY, set this parameter to M_NULL.

ControlFlag

Reserved for future expansion and must be set to M_DEFAULT.

The table below lists possible values for the Feature, Coord1OrPackedArrayPtr, Coord2ArrayPtr, and Coord3ArrayPtr parameters.

For putting points and data in a 3D reconstruction result buffer of type M_POINT_CLOUD_CONTAINER.

function map For putting points and data in a 3D reconstruction result buffer of type M_POINT_CLOUD_CONTAINER
CollapseFeature Description
Coord1OrPackedArrayPtr
Coord2ArrayPtr
Coord3ArrayPtr
Collapse M_INTENSITY

Specifies to add or remove the intensity (or gray level) at each point of an existing point cloud in the 3D reconstruction result buffer. If the points already have intensities, they are overwritten.

To remove all intensities from the point cloud, set Feature to M_INTENSITY and ArraySize to M_NULL.

(summarize)
Collapse Coord1OrPackedArrayPtr
Data type info
  • Data type: array of type MIL_UINT16
    Array size: the number of points in the point cloud
    Note: This only applies when the Type parameter is set to M_UNSIGNED + 16

  • Data type: array of type MIL_UINT8
    Array size: the number of points in the point cloud
    Note: This only applies when the Type parameter is set to M_UNSIGNED + 8

Specifies an array with the intensity (or gray level) of the points.

Collapse M_POSITION

Specifies to add position data to the point cloud using three separate arrays, one for each coordinate.

If you are using M_FLOAT + 32, invalid point coordinates must be set to M_INVALID_POINT_FLOAT. For M_FLOAT + 64, they must be set to M_INVALID_POINT.

(summarize)
Collapse Coord1OrPackedArrayPtr
Data type info
  • Data type: array of type MIL_FLOAT
    Array size: the number of points in the point cloud
    Note: This only applies when the Type parameter is set to M_FLOAT + 32

  • Data type: array of type MIL_DOUBLE
    Array size: the number of points in the point cloud
    Note: This only applies when the Type parameter is set to M_FLOAT + 64

Specifies the array with the X-coordinates.

Collapse Coord2ArrayPtr
Data type info
  • Data type: array of type MIL_DOUBLE
    Array size: the number of points in the point cloud
    Note: This only applies when the Type parameter is set to M_FLOAT + 64

  • Data type: array of type MIL_FLOAT
    Array size: the number of points in the point cloud
    Note: This only applies when the Type parameter is set to M_FLOAT + 32

Specifies the array with the Y-coordinates.

Collapse Coord3ArrayPtr
Data type info
  • Data type: array of type MIL_DOUBLE
    Array size: the number of points in the point cloud
    Note: This only applies when the Type parameter is set to M_FLOAT + 64

  • Data type: array of type MIL_FLOAT
    Array size: the number of points in the point cloud
    Note: This only applies when the Type parameter is set to M_FLOAT + 32

Specifies the array with the Z-coordinates.

Collapse M_XYZ

Specifies to add position data to the point cloud from a single packed array.

Note that if you are using M_FLOAT + 32, invalid point coordinates must be set to M_INVALID_POINT_FLOAT. For M_FLOAT + 64, they must be set to M_INVALID_POINT.

(summarize)
Collapse Coord1OrPackedArrayPtr
Data type info
  • Data type: array of type MIL_DOUBLE
    Array size: exactly 3 times the number of points in the point cloud
    Note: This only applies when the Type parameter is set to M_FLOAT + 64

  • Data type: array of type MIL_FLOAT
    Array size: exactly 3 times the number of points in the point cloud
    Note: This only applies when the Type parameter is set to M_FLOAT + 32

Specifies an array with coordinates in the following format: [X0, Y0, Z0, X1, Y1, Z1,...].

Collapse M_XYZI

Specifies to add position and intensity data to the point cloud from a single packed array.

Note that while you must specify an array of type float, the intensity data in that array must still be an unsigned 8-bit or 16-bit integer. If the intensity data is another data type, the stored value is unspecified.

Note that if you are using M_FLOAT + 32, invalid point coordinates must be set to M_INVALID_POINT_FLOAT. For M_FLOAT + 64, they must be set to M_INVALID_POINT.

(summarize)
Collapse Coord1OrPackedArrayPtr
Data type info
  • Data type: array of type MIL_DOUBLE
    Array size: exactly 4 times the number of points in the point cloud
    Note: This only applies when the Type parameter is set to M_FLOAT + 64

  • Data type: array of type MIL_FLOAT
    Array size: exactly 4 times the number of points in the point cloud
    Note: This only applies when the Type parameter is set to M_FLOAT + 32

Specifies an array with coordinates in the following format: [X0, Y0, Z0, I0, X1, Y1, Z1, I1,...].

Compilation information
Header Include mil.h.
Library Use mil.lib; mil3dmap.lib.
DLL Requires mil.dll; mil3dmap.dll.
LASER SCAN FLOAT 32 FLOAT 64 UNSIGNED 8 UNSIGNED 16 NULL 3D ROBOTICS TSAI BASED INTENSITY POSITION XYZ XYZI FLOAT 32 FLOAT 64 UNSIGNED 8 UNSIGNED 16