MIL_DOUBLE Src1ImageBufIdOrConst, | //in |
MIL_DOUBLE Src2ImageBufIdOrConst, | //in |
MIL_ID DstImageBufId, | //in |
MIL_INT64 Operation | //in |
This function performs the specified point-to-point operation on two images, an image and a constant, an image, or a constant, storing results in the specified destination image buffer.
You can limit this function's results to a region of an image buffer using a region of interest (ROI) set using MbufSetRegion(). The ROI must be defined in raster format (M_RASTER or M_VECTOR_AND_RASTER). An error is generated if the ROI is only in vector format (M_VECTOR). If you specify multiple image buffers with an ROI, results are limited to the portion of the ROIs that intersect.
Specifies the data source of the first operand. This parameter can be given an image buffer identifier or a constant. When using a constant, it will be considered to have the same type as the destination buffer. If you specify an image buffer that has an ROI associated with it, the ROI must be in raster format; otherwise, you will get an error.
Note that logical operations (for example M_AND and M_OR) cannot be performed on a floating-point buffer.
The source image buffer must be unsigned monochrome 8- or 16-bit, or M_BGR32 packed.
Specifies the data source of the second operand. This parameter can be given an image buffer identifier or a constant. If the selected operation uses only one operand, set this parameter to M_NULL. When using a constant, it will be considered to have the same type as the destination buffer. If you specify an image buffer that has an ROI associated with it, the ROI must be in raster format; otherwise, you will get an error.
Note that logical operations (for example M_AND and M_OR) cannot be performed on a floating-point buffer.
The source image buffer must be unsigned monochrome 8- or 16-bit, or M_BGR32 packed.
Specifies the identifier of the destination of the results. This parameter must be given an image buffer identifier. If you specify an image buffer that has an ROI associated with it, the ROI must be in raster format; otherwise, you will get an error.
The destination image buffer must be unsigned monochrome 8- or 16-bit, or M_BGR32 packed.
Specifies the operation to perform. This parameter should be set in accordance to the operands.
Supports packed binary buffers for logical operations (for example M_AND and M_OR).
Operations using two image buffer operands are the following:
For specifying the type of
operation
|
|||||||||||||||||||||||||||||||||||||||
Value | Description
|
||||||||||||||||||||||||||||||||||||||
M_ADD + |
Adds the values of the first image to the corresponding values of the second image. |
||||||||||||||||||||||||||||||||||||||
M_AND + |
Performs a bitwise AND operation between the values of the first and second images. |
||||||||||||||||||||||||||||||||||||||
M_ATAN2 |
Performs the two-argument arctangent function, atan2(x, y), using the first image for the X-coordinates and the second image for the Y-coordinates. (more details...) |
||||||||||||||||||||||||||||||||||||||
M_DIV + |
Divides the values of the first image by the values of the second image. (more details...) |
||||||||||||||||||||||||||||||||||||||
M_EXP |
Raises the values of the first image to the power of the second image's values. |
||||||||||||||||||||||||||||||||||||||
M_LOG |
Takes the logarithm of the values of the second image, to the base of the values of the first image. |
||||||||||||||||||||||||||||||||||||||
M_MAX |
Compares the values of the first image with the values of the second image, and takes the maximum of the two. |
||||||||||||||||||||||||||||||||||||||
M_MIN |
Compares the values of the first image with the values of the second image, and takes the minimum of the two. |
||||||||||||||||||||||||||||||||||||||
M_MULT + |
Multiplies the values of the first image with the values of the second image. |
||||||||||||||||||||||||||||||||||||||
M_NAND + |
Performs a bitwise NAND operation between the values of the first and second images. |
||||||||||||||||||||||||||||||||||||||
M_NOR + |
Performs a bitwise NOR operation between the values of the first and second images. |
||||||||||||||||||||||||||||||||||||||
M_OR + |
Performs a bitwise OR operation between the values of the first and second images. |
||||||||||||||||||||||||||||||||||||||
M_SUB + |
Subtracts the values of the second image from the values of the first image (for example, image 1 - image 2). |
||||||||||||||||||||||||||||||||||||||
M_SUB_ABS + |
Takes the absolute value of the result of subtracting the values of the second image from the values of the first image. |
||||||||||||||||||||||||||||||||||||||
M_XNOR + |
Performs a bitwise exclusive NOR operation between the values of the first and second images. |
||||||||||||||||||||||||||||||||||||||
M_XOR + |
Performs a bitwise exclusive OR operation between the first and second images. |
You can add the following value to the above-mentioned values to specify to use the logical operation rather than the bitwise operation.
For specifying to perform logical
operations
|
|||||||||||||||||||||||||||||||||||||||
Combination value | Description
|
||||||||||||||||||||||||||||||||||||||
M_LOGICAL |
Specifies to use the logical operation rather than the bitwise operation. (more details...) |
For a signed or unsigned destination buffer, the following logical operations will result in either the highest unsigned buffer value (regardless if the buffer is signed) or 0. For a floating-point buffer, the result will either be 0 or 1. Logical operations using two image buffer operands include the following.
For logical operations using two image
buffers
|
|||||||||||||||||||||||||||||||||||||||
Value | Description
|
||||||||||||||||||||||||||||||||||||||
M_EQUAL |
Determines if the values of the first and second images are equal. |
||||||||||||||||||||||||||||||||||||||
M_GREATER |
Determines if the values of the first image are greater than the second image. |
||||||||||||||||||||||||||||||||||||||
M_GREATER_OR_EQUAL |
Determines if the values of the first image are greater than or equal to the second image. |
||||||||||||||||||||||||||||||||||||||
M_LESS |
Determines if the values of the first image are less than the second image. |
||||||||||||||||||||||||||||||||||||||
M_LESS_OR_EQUAL |
Determines if the values of the first image are less than or equal to the second image. |
||||||||||||||||||||||||||||||||||||||
M_NOT_EQUAL |
Determines if the values of the first and second images are not equal. |
The following are operations that use an image buffer operand and a constant. If the operation is not commutative, you must pass the constant as either the first or second operand, as can be determined from the predefined operation name.
For operations using one image buffer and
a constant
|
|||||||||||||||||||||||||||||||||||||||
Value | Description
|
||||||||||||||||||||||||||||||||||||||
M_ADD_CONST + |
Adds a constant to the values of an image. |
||||||||||||||||||||||||||||||||||||||
M_AND_CONST + |
Performs a bitwise AND operation on the image and a constant. |
||||||||||||||||||||||||||||||||||||||
M_CONST_DIV + |
Divides a constant by the values of an image (for example, constant / image). (more details...) |
||||||||||||||||||||||||||||||||||||||
M_CONST_EXP |
Raises a constant to the power specified by the values of an image. |
||||||||||||||||||||||||||||||||||||||
M_CONST_LOG |
Takes the logarithm of the values of an image, to the base of a constant (for example LOG constant Image). |
||||||||||||||||||||||||||||||||||||||
M_CONST_PASS |
Copies the constant to each destination pixel. |
||||||||||||||||||||||||||||||||||||||
M_CONST_SUB + |
Subtracts the image from the constant (for example, constant - image). |
||||||||||||||||||||||||||||||||||||||
M_DIV_CONST + |
Divides the values of an image by a constant (for example, image / constant). (more details...) |
||||||||||||||||||||||||||||||||||||||
M_EXP_CONST + |
Raises the values of the image to the power specified by the constant. |
||||||||||||||||||||||||||||||||||||||
M_LOG_CONST |
Takes the logarithm of a constant, to the base of the values of an image (for example LOG image Constant). |
||||||||||||||||||||||||||||||||||||||
M_MAX_CONST |
Compares the values of one image with a constant, and takes the maximum of the two. |
||||||||||||||||||||||||||||||||||||||
M_MIN_CONST |
Compares the values of one image with a constant, and takes the minimum of the two. |
||||||||||||||||||||||||||||||||||||||
M_MULT_CONST + |
Multiplies the values of the image by the constant. |
||||||||||||||||||||||||||||||||||||||
M_NAND_CONST + |
Performs a bitwise NAND operation with an image and a constant. |
||||||||||||||||||||||||||||||||||||||
M_NOR_CONST + |
Performs a bitwise NOR operation with an image and a constant. |
||||||||||||||||||||||||||||||||||||||
M_OR_CONST + |
Performs a bitwise OR operation with an image and a constant. |
||||||||||||||||||||||||||||||||||||||
M_SUB_CONST + |
Subtracts a constant from the values of an image (for example, image - constant). |
||||||||||||||||||||||||||||||||||||||
M_XNOR_CONST + |
Performs a bitwise exclusive NOR operation with an image and a constant. |
||||||||||||||||||||||||||||||||||||||
M_XOR_CONST + |
Performs a bitwise exclusive OR operation with an image and a constant. |
You can add the following value to the above-mentioned values to specify that the operation is performed in fixed point format.
For specifying to perform operations in
fixed point format
|
|||||||||||||||||||||||||||||||||||||||
Combination value | Description
|
||||||||||||||||||||||||||||||||||||||
M_FIXED_POINT |
Forces the operation to be performed in a fixed point format. (more details...) |
You can add the following value to the above-mentioned values to specify that the operation is performed in floating-point format.
For specifying to perform operations in
floating-point format
|
|||||||||||||||||||||||||||||||||||||||
Combination value | Description
|
||||||||||||||||||||||||||||||||||||||
M_FLOAT_PROC |
Forces the operation to be performed in floating-point format. (more details...) |
For a signed or unsigned destination buffer, the following logical operations will result in either the highest unsigned buffer value (regardless if the buffer is signed) or 0. For a floating-point buffer, the result will either be 0 or 1. Logical operations using one image buffer and a constant include the following.
For logical operations using one image
buffer and a constant
|
|||||||||||||||||||||||||||||||||||||||
Value | Description
|
||||||||||||||||||||||||||||||||||||||
M_EQUAL_CONST |
Determines if the values of an image are equal to the specified constant. |
||||||||||||||||||||||||||||||||||||||
M_GREATER_CONST |
Determines if the values of an image are greater than the specified constant. |
||||||||||||||||||||||||||||||||||||||
M_GREATER_OR_EQUAL_CONST |
Determines if the values of an image are greater than or equal to the specified constant. |
||||||||||||||||||||||||||||||||||||||
M_LESS_CONST |
Determines if the values of an image are less than the specified constant. |
||||||||||||||||||||||||||||||||||||||
M_LESS_OR_EQUAL_CONST |
Determines if the values of an image are less than or equal to the specified constant. |
||||||||||||||||||||||||||||||||||||||
M_NOT_EQUAL_CONST |
Determines if the values of an image are not equal to the specified constant. |
Operations using only one image buffer operand are the following:
For operations using one image
buffer
|
|||||||||||||||||||||||||||||||||||||||
Value | Description
|
||||||||||||||||||||||||||||||||||||||
M_ABS |
Takes the absolute value of the image values. |
||||||||||||||||||||||||||||||||||||||
M_CUBE + |
Raises the image values to the power of 3 ( x 3 ). |
||||||||||||||||||||||||||||||||||||||
M_LN + |
Performs a natural logarithm on the image values. |
||||||||||||||||||||||||||||||||||||||
M_LOG2 + |
Performs a base-2 logarithm on the image values. |
||||||||||||||||||||||||||||||||||||||
M_LOG10 + |
Performs a base-10 logarithm on the image values. |
||||||||||||||||||||||||||||||||||||||
M_NEG |
Performs a unary negation operation (2's complement) on an image. (more details...) |
||||||||||||||||||||||||||||||||||||||
M_NOT + |
Performs a bitwise NOT operation (1's complement) on an image. (more details...) |
||||||||||||||||||||||||||||||||||||||
M_PASS |
Copies the source buffer to the destination image buffer. |
||||||||||||||||||||||||||||||||||||||
M_SQUARE + |
Raises the image values to the power of 2 ( x 2 ). |
||||||||||||||||||||||||||||||||||||||
M_SQUARE_ROOT + |
Performs a square root operation on the image values. |
You can add the following value to the above-mentioned values to specify that the operation result should be saturated if necessary.
For specifying to saturate
results that overflow or underflow
|
|||||||||||||||||||||||||||||||||||||||
Combination value | Description
|
||||||||||||||||||||||||||||||||||||||
M_SATURATION |
Forces the operation to saturate any resulting pixel values that overflow or underflow the possible range of the destination buffer. (more details...) |
Header | Include mil.h. |
Library | Use mil.lib; milim.lib. |
DLL | Requires mil.dll; milim.dll. |