Centroid from Fourier Transform

446 Views Asked by At

I have a discrete fourier transform from an black and white image and would like to have a rough estimation of the centroid of an white shape in it.

As far as I can tell from http://www.cs.otago.ac.nz/cosc453/student_tutorials/fourier_analysis.pdf I should be able to look at the first descriptor and it will map to x and y coordinates.

My own experiments with OpenCV:s dft have failed to produce any results that supports this. Is there more information regarding this property that I could read up on?

1

There are 1 best solutions below

0
On BEST ANSWER

Generally the main concept behind Fourrier analysis is that "suitable" functions can be reconstructed by standard building block functions. First, in 1 dimension, one took the functions $1, \cos(t),\sin(t),\cos(2t),\sin(2t),\ldots$. The reconstruction of the function then took the form $f(t)=a_0+a_1\cos(t)+b_1\sin(t)+a_2\cos(2t)+b_2\sin(2t)+\ldots$. These functions posess the remarkable property that they are othogonal in the sense that $\int\sin(nt)sin(mt)\mathrm{d}t$ is only $\neq 0$ if $m=n$. (It is not unnatural that these functions also represent the modes of vibrations of a thin metal rod). It is just this property of orthogonality that permits us to filter out how much of a building block function should be used, hence the formulas for the calculation of the coefficients. For more information look here.The use of Euler's formula permits us to use the functions $1,e^{\iota t},e^{\iota 2t}e^{\iota 3t},\ldots$ instead. The application of Fourrier analysis in the article you mention is not the classical Fourrier analysis on 2D images, it is still a 1 dimensional application (it took me a while to see through that one). It is related to images in the sense that not all the pixels of the image are analysed but only a finite sequence of points $p_1,p_2,\ldots,p_N$ that describe the contour of an object. Since points in a plane can be considered complex numbers classical Fourrier analysis can be used. The first term in the series is a constant point that equals the sum of the vectors of the contour, so it is the "center of gravitiy" or "centroid" of the object. The following term is of the form $a_1e^{\iota t}$ which is indeed a circle. This can be seen in this plot. This circle around the object is the one that best suits the points. Intuitively one can imagine the radius of this circle as the mean disctance. It is interesting to see what adding another term to the series does in this plot. If you have more questions please don't hesitate.