MimArithMultiple()函数

MimArithMultiple()函数

Synopsis

Perform a point-to-point arithmetic operation using multiple source images.

Format

void MimArithMultiple(Src1ImageBufId, Src2ImageBufId, Src3ImageBufId, Src4ImageBufId, Src5ImageBufId, DestImageBufId, Operation, OperationFlag)

double Src1ImageBufId;??? Source 1 image buffer identifier or a constant
double Src2ImageBufId;??? Source 2 image buffer identifier or a constant
double Src3ImageBufId;??? Source 3 image buffer identifier or a constant
double Src4ImageBufId;??? Source 4 image buffer identifier or a constant
double Src5ImageBufId;??? Source 5 image buffer identifier or a constant
MIL_ID DestImageBufId;??? Destination image buffer identifier
long Operation;??? Operation to perform
long OperationFlag;??? Flag associated with the Operation argument

Description

This function performs the specified point-to-point operation requiring multiple images, images and constants, or constants, storing results in the specified destination image buffer.
The Src…ImageBufId parameters specify the data sources of the operands. These parameters can be given an image buffer identifier or a constant. If the selected operation does not require all of the possible operands, set the excess source buffer parameters to M_NULL.
The DestImageBufId parameter specifies the identifier of the destination of the results. This parameter must be given an image buffer identifier.

The Operation parameter specifies the operation to perform. The following table lists the valid multiple operation names, their equations, and their descriptions, as well as their requirements for the sources of the operands:

Operation, Equation, and Description???? Source1??? Source2??? Source3??? Source 4??? Source5
M_OFFSET_GAIN
((Src1 – Src2) * Src3) / Src4
Apply per-pixel gain and offset correction to
an image.
image*
image*
image*??? constant andpowerof 2
M_NULL
* These image buffers must be of the same type.

M_WEIGHTED_AVERAGE
((Src1 – Src3) / Src2) + Src3
Apply a weighted averaging to an image and place the results in an accumulator.
image*??? constantandpower of 2
image*
M_NULL
M_NULL
* These image buffers must be of the same type.

M_MULTIPLY_ACCUMULATE_1
((Src1 * Src2) + Src3) / Src4
Apply the stated equation to the specified image.
image
constant*
constant*??? constant* andpowerof 2
M_NULL
* These constants are cast in the same type as
the source 1 image buffer.

M_MULTIPLY_ACCUMULATE_2
((Src1 * Src2) + (Src3 * Src4)) / Src5
Apply the stated equation to the specified images.
image*
constant*
image*
constant*??? constantandpower of 2
* The image buffers and the constants must be of
the same type (signed or unsigned).

To force the operations to saturate when the resulting value overflows or underflows add M_SATURATION to the operation name (for example, M_OFFSET_GAIN+M_SATURATION). In the case of M_OFFSET_GAIN (with unsigned buffers), an additional saturation to 0 is performed after the subtraction in order to avoid negative underflows.

The OperationFlag parameter must be set to M_DEFAULT.

Status

In-place processing is supported (source equals destination), but the source and destination image buffers cannot partially overlap (a situation that can only occur when using child buffers).

注:只有4种操作,M_OFFSET_GAIN 、M_WEIGHTED_AVERAGE 、M_MULTIPLY_ACCUMULATE_1、M_MULTIPLY_ACCUMULATE_2,具体计算方法上面已讲,这不再展开讲。最后一个输入参数必须为M_DEFAULT.

《MimArithMultiple()函数》上有30条评论

评论已关闭。