Differences between revisions 1 and 2
Revision 1 as of 2006-08-04 19:38:34
Size: 1765
Editor: penczek
Comment:
Revision 2 as of 2007-06-28 17:06:20
Size: 1754
Editor: cpe-24-167-47-215
Comment:
Deletions are marked like this. Additions are marked like this.
Line 8: Line 8:
    par1:: image - input image (real)     image:: input image (real)
Line 11: Line 11:
    out1:: output - normalized autocorrelation function of the input image. Real. The origin of the autocorrelation function (term ccf(0,0,0)) is located at (int[n/2], int[n/2], int[n/2]) in 3D, (int[n/2], int[n/2]) in 2D, and at int[n/2] in 1D.     output::   normalized autocorrelation function of the input image. Real. The origin of the autocorrelation function (term ccf(0,0,0)) is located at (int[n/2], int[n/2], int[n/2]) in 3D, (int[n/2], int[n/2]) in 2D, and at int[n/2] in 1D.

Name

acfnp - calculate the normalized autocorrelation function of an image using padding with zeroes and multiplication in Fourier space.

Usage

output = acfnp(image)

Input

image
input image (real)

Output

output
normalized autocorrelation function of the input image. Real. The origin of the autocorrelation function (term ccf(0,0,0)) is located at (int[n/2], int[n/2], int[n/2]) in 3D, (int[n/2], int[n/2]) in 2D, and at int[n/2] in 1D.

Method

  • Calculation of the normalized autocorrelation function of an image f is performed by first normalization of the image by subtracting its average and by dividing it by its standard deviation. Next, theh image is padded with zeroes to twice the size in real space, Fourier transform is calculated, its modulus squared in Fourier space calculated as `|hat(f)|^2`, then the inverse Fourier transform, and finally the acfnp is windowed out using the size of original images.

  • In real space, this corresponds to:
  • `c\cfnp(n)=(1/(nx)(sum_(k=0)^(nx-1)f((k+n)-Ave_f)(f(k)-Ave_g)))/(sigma_f^2`

  • `n = -(nx)/2, ..., (nx)/2`

  • with the assumption that `f(k)=0 fo\r k<0 or kgenx`

  • Note: acfnp is free from "wrap around" artifacts, although coefficients with large lag n have large error (statistical uncertainty).

Reference

Pratt, W. K., 1992. Digital image processing. Wiley, New York.

Author / Maintainer

Pawel A. Penczek

Keywords

category 1
FUNDAMENTALS
category 2
FOURIER

Files

fundamentals.cpp

Maturity

stable
works for most people, has been tested; test cases/examples available.

Bugs

None. It is perfect.

acfnp (last edited 2013-07-01 13:12:56 by localhost)