Where can I find a good source of information explaining FFT phase correlation

I was looking for great OpenCV source code to understand point calculation. As you may have noticed, the library may find a template in the image with a confidence rating. The cvMatchTemplate function gives the likelihood and location of the template in the image.

Since DFT is slow, I decided to use the FFTW library for phase correlation. I get an image expanded to a size equal to 2, then I did the same with the template, first calculated the FFT for both, multiplied two arrays, calculated the inverse FFT, and finally normalized the result.

If I show this result in a bitmap, it clearly shows the location of the template, however, it is difficult for me to calculate the correlation index. I tried to run the cvMatchTemplate method line by line under the debugger, this did not help, since the library uses DFT and arbitrary image sizes. All tables used in this method (sum, sqsum, etc.) are created for the corresponding arbitrary sizes, and the FFT uses the powers of the two.

I would appreciate any information on how to calculate the estimate for this phase correlation result. There are many sources describing "take it, take it, multiply them, you see a white dot in the image, yes, you find it." I need an account, as cvMatchTemplate did.

I ask you to point me to a website or to a paper containing the logic of this calculation or a book. The source code would be perfect, but in any case, I have no hope.

+4
source share
2 answers

First, make sure you do not "expand the image to 2". I am sure you did not mean this, but in any case with FFTW you can calculate an arbitrary FT size.

I do not understand what you are using OpenCV for. If you have an FFT, it’s pretty easy to calculate the normalized transverse power spectrum, in other words, the “phase correlation formula”.

Get the largest FFT size of images you can without forgetting about the window. Calculate CPS. When you have a correlation surface, find the peak.

I don’t know what OpenCV offers for phase correlation except FT, but the paper you need

GA Thomas, Television Motion Measurement for DATV and Other Applications, 1987, BBC Research Department.

+1
source

1) FFTW can work with arrays no larger than 2.

2) The object you can search / study is the FFT cross-correlation theorem:

"The Fourier transform of the cross-correlation of two functions is equivalent to the product of individual Fourier transforms, where one of them was complex conjugate"

+1
source

Source: https://habr.com/ru/post/1334786/


All Articles