MIL_ID Src1ImageBufOrGeometry3dmapId, | //in |
MIL_ID Src2ImageBufOrGeometry3dmapId, | //in |
MIL_ID DstImageBufId, | //in |
MIL_ID MaskBufId, | //in |
MIL_INT64 Operation, | //in |
MIL_INT64 ControlFlag | //in |
This function performs the specified point-to-point arithmetic operation on two depth maps or one depth map and one geometry object, storing the resulting depth map in the specified destination image buffer. Note that M3dmapArith() cannot be called with two geometry object operands.
All image operands must be fully corrected depth maps for this operation. To determine if you have a fully corrected depth map, call McalInquire() with M_GRAY_LEVEL_SIZE_Z and ensure that it does not return M_INVALID_SCALE. Moreover, if the two operands are images, they must have the same calibration information.
All operations are performed on the Z-world coordinates corresponding to the gray levels of the image operands or the surface point of a geometry operand. The resulting Z-world coordinates are then converted back to gray levels, according to the calibration information of the destination buffer. If the Z-scale and Z-offset of the destination are such that the 3D point falls outside the vertical span of the destination buffer, the destination pixel will be saturated to either 0 or the maximum value of the buffer, minus 1 (since the maximum value of a depth map represents missing data).
Some pixels of the destination buffer can be left unchanged by providing a mask image buffer with the corresponding pixels set to 0.
By default, the destination buffer does not have to be calibrated before calling M3dmapArith(). The function will fill the destination buffer and associate it with the necessary calibration information. You can, however, specify to use the existing calibration information of the destination buffer, by passing M_USE_DESTINATION_SCALES to ControlFlag parameter.
If either or both operands contain missing data (represented using the maximum value of the depth map buffer), missing data might be written to the destination buffer, depending on the value passed to the Operation parameter.
Specifies the data source of the first operand.
For specifying the data source of the
first operand
|
|||||||||||||||||||||||||||||||||||||||
Value | Description
|
||||||||||||||||||||||||||||||||||||||
Geometry object identifier |
Specifies the first operand to be a geometry object. (more details...) |
||||||||||||||||||||||||||||||||||||||
Image buffer identifier |
Specifies the first operand to be an image buffer that contains a depth map. (more details...) |
Specifies the data source of the second operand.
For specifying the data source of the
second operand
|
|||||||||||||||||||||||||||||||||||||||
Value | Description
|
||||||||||||||||||||||||||||||||||||||
Geometry object identifier |
Specifies the second operand to be a geometry object. (more details...) |
||||||||||||||||||||||||||||||||||||||
Image buffer identifier |
Specifies the second operand to be an image buffer that contains a depth map. (more details...) |
Specifies the identifier of the destination image buffer in which to put the result of the arithmetic operation. The image buffer must be a 1-band, 8-bit or 16-bit unsigned buffer.
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.
Specifies the identifier of the image buffer used as a mask.
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.
For specifying the mask
|
|||||||||||||||||||||||||||||||||||||||
Value | Description
|
||||||||||||||||||||||||||||||||||||||
M_NULL |
Specifies that all pixels of the destination will be written to. |
||||||||||||||||||||||||||||||||||||||
Image buffer identifier |
Specifies the identifier of the image buffer used as a mask in the arithmetic operation. (more details...) |
Specifies the operation to perform.
You can set the Operation parameter to one of the following possible values.
For specifying the operation to
perform
|
|||||||||||||||||||||||||||||||||||||||
Value | Description
|
||||||||||||||||||||||||||||||||||||||
M_ADD |
Adds the Z-coordinate of the first operand to the Z-coordinate of the second operand. (more details...) |
||||||||||||||||||||||||||||||||||||||
M_MAX |
Compares the Z-coordinate of the first operand with the Z-coordinate of the second operand, and takes the greater of the two. (more details...) |
||||||||||||||||||||||||||||||||||||||
M_MIN |
Compares the Z-coordinate of the first operand with the Z-coordinate of the second operand, and takes the lesser of the two. (more details...) |
||||||||||||||||||||||||||||||||||||||
M_SUB |
Subtracts the Z-coordinate of the second operand from the Z-coordinate of the first operand. (more details...) |
||||||||||||||||||||||||||||||||||||||
M_SUB_ABS |
Subtracts the Z-coordinate of the second operand from the Z-coordinate of the first operand, and takes the absolute value of the result. (more details...) |
Specifies how to handle the calibration information of the destination buffer.
You can set the ControlFlag parameter to one of the following possible values.
For specifying how to handle calibration
information
|
|||||||||||||||||||||||||||||||||||||||
Value | Description
|
||||||||||||||||||||||||||||||||||||||
M_DEFAULT |
Same as M_FIT_SCALES. |
||||||||||||||||||||||||||||||||||||||
M_FIT_SCALES |
Specifies to choose the Z-scale and Z-offset so that all possible values can be represented in the destination image buffer without saturation. (more details...) |
||||||||||||||||||||||||||||||||||||||
M_SET_WORLD_OFFSET_Z |
Specifies to keep the same Z-scale as the source image(s) and set the Z-offset so that the destination buffer Z-range covers the center of the possible range of the data. (more details...) |
||||||||||||||||||||||||||||||||||||||
M_USE_DESTINATION_SCALES |
Specifies to use the calibration information of the destination buffer. (more details...) |
Header | Include mil.h. |
Library | Use mil.lib; mil3dmap.lib. |
DLL | Requires mil.dll; mil3dmap.dll. |