Adds two images pixel by pixel.
void avl::AddImages ( const avl::Image& inImage1, const avl::Image& inImage2, atl::Optional<const avl::Region&> inRoi, float inScale, avl::Image& outImage )
|inImage1||const Image&||First input image|
|inImage2||const Image&||Second input image|
|inRoi||Optional<const Region&>||NIL||Range of pixels to be processed|
|inScale||float||1.0f||Output image scaling factor|
The operation computes the sum of two images. Each outImage pixel is equal to the sum of the corresponding pixels of the input images.
The result of the operation is multiplied by inScale factor, which may be used to avoid clipping when the produced values exceed the range of correct pixel values. However it should be noted that when the value of inScale is other than 1.0, the filter uses a slower, not SSE-optimized implementation.
Whenever the resulting value exceeds the range of pixel values, it is clipped to the nearest proper value. In multichannel (color) images each pixel channel is processed separately.
The operation requires that the images being processed have equal format and dimensions, otherwise an error with appropriate description occurs. To obtain an image of desired dimensions one can use ResizeImage or CropImage filter. To alter the pixel type of an image one can use ConvertPixelType filter. ConvertToMultichannel and AverageChannels filters allow to alter the number of image channels.
This function supports in-place data processing - you can pass the same reference to inImage1 and outImage, inImage2 and outImage
This operation is optimized for SSE2 technology for pixels of types: UINT8, SINT16, REAL, SINT8(for inScale=1), UINT16(for inScale=1).
This operation supports automatic parallelization for multicore and multiprocessor systems.
|DomainError||Image sizes are not equal in AddImages.|
|DomainError||Image formats are not the same in AddImages.|
- SubtractImages – Subtracts two images pixel by pixel. The result is signed.