IMcOperations2Div2Ex Method
|
|
Division of an image by another using 2 correction factors.
Namespace:
MediaCy.IQL.Operations
Assembly:
MediaCy.IQL.Operations (in MediaCy.IQL.Operations.dll) Version: 10.0.6912.0
SyntaxFunction Div2Ex (
vOperand2 As Object,
<OptionalAttribute> ScaleOffset As Object,
<OptionalAttribute> AdditiveOffset As Object,
Optional ConversionMode As mcConversionMode = mcConversionMode.mccmDirect,
<OptionalAttribute> vOperand1 As Object
) As McImage
Parameters
- vOperand2
- Type: SystemObject
Right hand operand of the operation. A McImage only. - ScaleOffset (Optional)
- Type: SystemObject
If given, a single number or an array of numbers, one for each
destination McImage channel, used as an multiplicative offset to scale the
offset division. - AdditiveOffset (Optional)
- Type: SystemObject
If given, a single number or an array of numbers, one for
each destination McImage channel, used as a subtractive offset for both the
numerator and denominator and then as an additive offset for the scaled
result. - ConversionMode (Optional)
- Type: MediaCy.IQL.OperationsmcConversionMode
If given, specifies if the pixels of a vOperand2 McImage
should be scaled or copied directly when the bit depth of vOperand2 and the
destination image differ. The value is mccmDirect by default, which is most
often appropriate for arithmetic operations on images. - vOperand1 (Optional)
- Type: SystemObject
Optional first image operand (operator applies to parent image
when parameter is omitted).
Return Value
Type:
McImageThe resulting McImage
RemarksThe Div2Ex operation does a division of the vOperand1 image (which is
the Parent image by default) by the vOperand2 image, applying two correction
factors or "offsets". One offset (given by the ScaleOffset argument) is
multiplicative and the other (given by the AdditiveOffset argument) is additive.
Div2Ex is typically used to compute the luminance ratio between two images,
corrected for a background luminance (the AdditiveOffset) common to both images.
The result is:
(ScaleOffset * (vOperand1 - AdditiveOffset) / (vOperand2 - AdditiveOffset)) + AdditiveOffset
Any ScaleOffset value of zero is ignored (i.e., it is treated as 1). If (vOperand1 -
AdditiveOffset) is zero or negative, then the result is set to zero. If (vOperand2 -
AdditiveOffset) is zero or negative, then the result is set to the destination
McImage.RangeMax.
A conversion is performed on vOperand2 so that it has the same type as the
destination McImage. The conversion rules are defined by the value of the
ConversionMode argument.
The result is stored in the parent image or vOperand1 if there is no parent.
Unlike most other McOperations methods, neither operand can be a number; both
operands must be images.
For floating point image types, the stored results may exceed the bounds
of the current destination McImage.RangeMin to McImage.RangeMax. These
range properties are not changed automatically.
See Also