You are here: Start » AVL.NET » AVL.DifferenceImage_Flex(AvlNet.Image, AvlNet.Image, int, int?, AvlNet.TileTranslationMode, AvlNet.Image)

AVL.DifferenceImage_Flex(AvlNet.Image, AvlNet.Image, int, int?, AvlNet.TileTranslationMode, AvlNet.Image)

Namespace:AvlNet
Assembly:AVL.NET.dll

Syntax


public static void DifferenceImage_Flex(
	AvlNet.Image inImage1,
	AvlNet.Image inImage2,
	int inTileWidth,
	int? inTileHeight,
	AvlNet.TileTranslationMode inTileTranslationMode,
	out AvlNet.Image outImage
)

Parameters

inImage1
Type: AvlNet.Image
inImage2
Type: AvlNet.Image
inTileWidth
Type: System.Int32
inTileHeight
Type: System.Nullable<System.Int32>
inTileTranslationMode
Type: AvlNet.TileTranslationMode
outImage
Type: AvlNet.Image

Description

The operation computes the absolute difference between images. First the input images are divided into tiles. Each tile is then considered separately. It is translated by a minimal vector in one of the number of directions (depending on inTileTranslationMode, 4 or 8) and the translation with minimum overall difference between input images in this tile is considered to be the proper one. Finally, the output image values in the tile are computed using the so computed translation and the same formula like in DifferenceImage_Shifted.

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

DifferenceImage_Flex performed on the sample images with inTileWidth = inTileHeight = 16 and inTileTranslationMode = EightDirections.

Errors

Error type Description
DomainError Image sizes are not equal in DifferenceImage_Flex.
DomainError Image formats are not the same in DifferenceImage_Flex.

See also