# Calculating the quality of phase correlation

Started by April 21, 2010
```Hello,

I'm using phase correlation to perform motion estimation on video and
am trying to find some sort of metric for the quality of a peak (which
corresponds to a candidate motion vector) in a given phase correlation
block.  I know that performing phase correlation on duplicate images
gives a result that has a peak at (0, 0) with magnitude 1 and 0
elsewhere.  Obviously, in real video there is noise, multiple
instances of object motion, and sub-pixel motion that causes there to
be multiple peaks that which are smeared over several bins.  Does
anyone know of any equalities in general, e.g. the sum of all the bins
in a phase correlation block equals 1 or the sum of the squares of all
the bins in a phase correlation block equals 1, or something along
those lines for the result of doing phase correlation on any two
frames?  The closest statement I've seen to broaching this subject is
in Watkinson, J., "An Engineer's Guide to Motion Compensation" where
he says "The volume of the peak corresponds to the amount of the area
of the window (i.e. the number of pixels) having that motion."  Does
anyone know anything more along these lines?

Thanks,
Joey
```
```On Apr 21, 1:03&#4294967295;pm, Joseph Greer <josephdgr...@gmail.com> wrote:
> Hello,
>
> I'm using phase correlation to perform motion estimation on video and
> am trying to find some sort of metric for the quality of a peak (which
> corresponds to a candidate motion vector) in a given phase correlation
> block. &#4294967295;I know that performing phase correlation on duplicate images
> gives a result that has a peak at (0, 0) with magnitude 1 and 0
> elsewhere. &#4294967295;Obviously, in real video there is noise, multiple
> instances of object motion, and sub-pixel motion that causes there to
> be multiple peaks that which are smeared over several bins. &#4294967295;Does
> anyone know of any equalities in general, e.g. the sum of all the bins
> in a phase correlation block equals 1 or the sum of the squares of all
> the bins in a phase correlation block equals 1, or something along
> those lines for the result of doing phase correlation on any two
> frames? &#4294967295;The closest statement I've seen to broaching this subject is
> in Watkinson, J., "An Engineer's Guide to Motion Compensation" where
> he says "The volume of the peak corresponds to the amount of the area
> of the window (i.e. the number of pixels) having that motion." &#4294967295;Does
> anyone know anything more along these lines?
>
> Thanks,
> Joey

For correlations in general (not necessarily applicable to phase
correlations),
the sum of all the cross-correlation values equals the product of the
sums
of x and y.  That is,

sum(over all l) C_{x,y}(l) = [sum(over all l) x(l)][sum over all l)
y(l)]

and

sum(over all l) [C{x,y}(l)^2 = sum(over all l) C{x,x}(l).C{y,y}(l)

that is, the squared length of the C_{x,y} sequence equals the inner
product of the autocorrelation sequences.

Hope this helps

--Dilip Sarwate
```