You are here: Start » AVL.NET » Function Reference » Image » Image Combinators » AVL.LerpImages

AVL.LerpImages

Interpolates two images linearly pixel by pixel.

Namespace:AvlNet
Assembly:AVL.NET.dll

Syntax

C++
C#
 
public static void LerpImages
(
	AvlNet.Image inImage1,
	AvlNet.Image inImage2,
	float inLambda,
	AvlNet.Image outImage
)

Parameters

Name Type Range Default Description
inImage1AvlNet.ImageFirst input image.
inImage2AvlNet.ImageSecond input image.
inLambdafloat<0.0f, 1.0f>0.5fInterpolation between the input images where 0.0 value is equal to inImage1 and 1.0 to inImage2. Default value: 0.5f.
outImageAvlNet.ImageOutput image.

Description

The operation computes the linear interpolation of two images. Each pixel of the output image is computed as follows. \[ outImage[i,j] = (1-inLambda) \cdot inImage0[i,j] + inLambda \cdot inImage1[i,j] \]

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.

Hardware Acceleration

This operation is optimized for SSE2 technology for pixels of types: UINT8, SINT16, REAL.

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

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

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 LerpImages.
DomainError Image sizes are not equal in LerpImages.
DomainError Region exceeds an input image in LerpImages.

Function Overrides

See also