You are here: Start » FIL.NET » Function Reference » Image » Image Combinators » FIL.AddImages

FIL.AddImages

Adds two images pixel by pixel.

Namespace:FilNet
Assembly:FIL.NET.dll

Syntax

C++
C#
 
public static void AddImages
(
	FilNet.Image inImage1,
	FilNet.Image inImage2,
	NullableRef<FilNet.Region> inRoi,
	float inScale,
	FilNet.Image outImage
)

Parameters

Name Type Range Default Description
inImage1FilNet.ImageFirst input image.
inImage2FilNet.ImageSecond input image.
inRoiFilNet.NullableRef<FilNet.Region>Range of pixels to be processed. Default value: ftl::NIL.
inScalefloat1.0fOutput image scaling factor. Default value: 1.0f.
outImageFilNet.ImageOutput image.

Description

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.

Examples

AddImages performed on the sample images.

Hardware Acceleration

This operation is optimized for SSE2 technology for pixels of types: UINT8, SINT8, SINT16, REAL, SINT8(for inScale=1), UINT16(for inScale=1).

This operation is optimized for SSE41 technology for pixels of types: UINT16(for inScale!=1).

This operation is optimized for AVX2 technology for pixels of types: UINT8, SINT8, SINT16, UINT16, REAL.

This operation is optimized for NEON technology for pixels of types: UINT8, SINT8, UINT16, SINT16, REAL(for inScale!=1), SINT32(for inScale!=1).

This operation supports automatic parallelization for multicore and multiprocessor systems.

Hardware acceleration settings may be manipulated with Settings class.

Errors

List of possible exceptions:

Error type Description
DomainError Image formats are not the same in AddImages.
DomainError Image sizes are not equal in AddImages.
DomainError Region exceeds an input image in AddImages.

Function Overrides

See also