input | autocorrelation | self convolution |
Files used in this study may be downloaded from: autoself.zip
input image: single.tif, method: auto.m
» a = imread('single.tif'); » out = auto(a);
The autocorrelation of the cyl(r)
function shown above
is given in the following routine:
A cross-section of the autocorrelation function is shown below
The marked data points are taken from a horizontal
cross-section of the output image. The solid curve is the
ideal function, which was generated from
ideal(r/8)
. The factor of 8 converts
pixel distance to the appropriate normalized distance.
» x = 0:8; » y = out(65,x+65); » plot(x,y); » xi = linspace(0,8,100); » yi = ideal(xi/8); » plot(x,y,'o',xi,yi); » xlabel('radius (pixels)'); » ylabel('value');
The agreement between theory and calculation is not as good as we might wish. To test the hypothesis that the disagreement is due to sampling error, we increased the size of the circle by four so that its autocorrelation just fits in a 64 x 64 array. The results, shown below, are much more satisfactory.
» a = imread('circ.tif'); » out = auto(a); » x = 0:31; » y = out(33,33+x); » xi = linspace(0,31,100); » yi = ideal(xi/32); » plot(x,y,'o',xi,yi); » xlabel('radius (pixels)'); » ylabel('value');
The input function consists of two circles (cylinder functions), one displaced 8 pixels to the left and the other 8 pixels to the right. Each circle is 8 pixels in diameter. A cross-section of the autocorrelation function is shown below
There are three peaks. The central peak is twice the height of its neighbors. The relative peak heights and locations are shown in the diagram (b) below.
(a) | (b) |
If the input function is real and has inversion symmetry (f(-x,-y) = f(x,y)) then the autocorrelation function is the same as the self convolution function. This example shows an input function without inversion symmetry.
input | auto.m | self.m |
The patterns above are simple enough to be reasoned mentally. However, the Matlab function peak.m can be used to search for peaks in an image. The results of applying this program to the autocorrelation image are:
» a = imread('triple.tif'); » b = auto(a); » peak(b,0.05,8); image size: 64 x 64 block size: 8 threshold: 0.05 max # peaks: 20 peak value row col 1 1.000000 33 33 2 0.333333 17 17 3 0.333333 33 17 4 0.333333 17 33 5 0.333333 49 33 6 0.333333 33 49 7 0.333333 49 49
The autocorrelation of the input image, input
,
can be constructed from the command
» out = auto(input);
where auto
is the following Matlab file
The self convolution of the input image, input
,
can be constructed from the command
» out = self(input);
where self
is the following Matlab file:
Maintained by John Loomis, last updated 8 March 2000