correlation_fft ( ImageFFT1, ImageFFT2 : ImageCorrelation : : )

Compute the correlation of two images in the frequency domain.

correlation_fft calculates the correlation of the Fourier-transformed input images in the frequency domain. The correlation is calculated by multiplying ImageFFT1 with the complex conjugate of ImageFFT2. It should be noted that in order to achieve a correct scaling of the correlation in the spatial domain, the operators fft_generic or rft_generic with Norm = 'none' must be used for the forward transform and fft_generic or rft_generic with Norm = 'n' for the reverse transform. If ImageFFT1 and ImageFFT2 contain the same number of images, the corresponding images are correlated pairwise. Otherwise, ImageFFT2 must contain only one single image. In this case, the correlation is performed for each image of ImageFFT1 with ImageFFT2 .


Attention

The filtering is always performed on the entire image, i.e., the domain of the image is ignored.


Parameters

ImageFFT1 (input_object)
image(-array) -> object : complex
Fourier-transformed input image 1.

ImageFFT2 (input_object)
image(-array) -> object : complex
Fourier-transformed input image 2.
Number of elements: (ImageFFT2 == ImageFFT1) || (ImageFFT2 == 1)

ImageCorrelation (output_object)
image(-array) -> object : complex
Correlation of the input images in the frequency domain.


Example
/* Compute the auto-correlation of an image. */
get_image_pointer1(Image,Pointer,Type,Width,Height)
rft_generic(Image,ImageFFT,'to_freq','none','complex',Width)
correlation_fft(ImageFFT,ImageFFT:Correlation)
rft_generic(Correlation,AutoCorrelation,'from_freq','n','real',Width)

Result

convol_fft returns 2 (H_MSG_TRUE) if all parameters are correct. If the input is empty the behavior can be set via set_system(::'no_object_result',<Result>:). If necessary, an exception handling is raised.


Parallelization Information

correlation_fft is reentrant and automatically parallelized (on tuple level).


Possible Predecessors

fft_generic, fft_image, rft_generic


Possible Successors

fft_generic, fft_image_inv, rft_generic


Module

Foundation



Copyright © 1996-2008 MVTec Software GmbH