ArticleslgStudy

computer science

Phase correlation

Phase correlation is a computer science topic covered in the lgStudy science library. This page brings together a partial reference excerpt, illustrations, worked examples, real-world applications and a short study plan, so you can understand Phase correlation rather than just read about it. In short: Phase correlation is an approach to estimate the relative translative offset between two similar images (digital image correlation) or other data sets. It is commonly used in image registration and relies on a frequency-domain representation of the data, usually calculated by fast Fourier transforms.

Phase correlation — main illustration
Phase correlation — illustration

Key takeaways

  • Phase correlation belongs to computer science; place it in that map before memorising details.
  • Learn the definition first, then one example that makes the definition concrete.
  • Connect Phase correlation to a quantity you can measure, compute or draw — that is where exam questions come from.
  • Reproduce the core statement of Phase correlation from memory before moving on to harder problems.

Reference excerpt

Phase correlation is an approach to estimate the relative translative offset between two similar images (digital image correlation) or other data sets. It is commonly used in image registration and relies on a frequency-domain representation of the data, usually calculated by fast Fourier transforms. The term is applied particularly to a subset of cross-correlation techniques that isolate the phase information from the Fourier-space representation of the cross-correlogram.

Example The following image demonstrates the usage of phase correlation to determine relative translative movement between two images corrupted by independent Gaussian noise. The image was translated by (20,23) pixels. Accordingly, one can clearly see a peak in the phase-correlation representation at approximately (20,23).

Method Given two input images ga and gb: Apply a window function (e.g., a Hamming window) on both images to reduce edge effects (this may be optional depending on the image characteristics). Then, calculate the discrete 2D Fourier transform of both images.

𝐆a=ℱ{ga},𝐆b=ℱ{gb} Calculate the cross-power spectrum by taking the complex conjugate of the second result, multiplying the Fourier transforms together elementwise, and normalizing this product elementwise.

R=𝐆a∘𝐆b∗|𝐆a∘𝐆b∗| Where ∘ is the Hadamard product (entry-wise product) and the absolute values are taken entry-wise as well. Written out entry-wise for element index (j,k):

Rjk=Ga,jk⋅Gb,jk∗|Ga,jk⋅Gb,jk∗| Obtain the normalized cross-correlation by applying the inverse Fourier transform.

r=ℱ−1{R} Determine the location of the peak in r.

(Δx,Δy)=arg⁡max(x,y){r}

Subpixel registration Commonly, interpolation methods are used to estimate the peak location in the cross-correlogram to non-integer values, despite the fact that the data are discrete, and this procedure is often termed 'subpixel registration'. A large variety of subpixel interpolation methods are given in the technical literature. Common peak interpolation methods such as parabolic interpolation have been used, and the OpenCV computer vision package uses a centroid-based method, though these generally have inferior accuracy compared to more sophisticated methods. Because the Fourier representation of the data has already been computed, it is especially convenient to use the Fourier shift theorem with real-valued (sub-integer) shifts for this purpose, which essentially interpolates using the sinusoidal basis functions of the Fourier transform. An especially popular FT-based estimator is given by Foroosh et al. In this method, the subpixel peak location is approximated by a simple formula involving peak pixel value and the values of its nearest neighbors, where r(0,0) is the peak value and r(1,0) is the nearest neighbor in the x direction (assuming, as in most approaches, that the integer shift has already been found and the comparand images differ only by a subpixel shift).

Δx=r(1,0)r(1,0)±r(0,0) The Foroosh et al. method is quite fast compared to most methods, though it is not always the most accurate. Some methods shift the peak in Fourier space and apply non-linear optimization to maximize the correlogram peak, but these tend to be very slow since they must apply an inverse Fourier transform or its equivalent in the objective function. It is also possible to infer the peak location from phase characteristics in Fourier space without the inverse transformation, as noted by Stone. These methods usually use a linear least squares (LLS) fit of the phase angles to a planar model. The long latency of the phase angle computation in these methods is a disadvantage, but the speed can sometimes be comparable to the Foroosh et al. method depending on the image size. They often compare favorably in speed to the multiple iterations of extremely slow objective functions in iterative non-linear methods. Since all subpixel shift computation methods are fundamentally interpolative, the performance of a particular method depends on how well the underlying data conform to the assumptions in the interpolator. This fact also may limit the usefulness of high numerical accuracy in an algorithm, since the uncertainty due to interpolation method choice may be larger than any numerical or approximation error in the particular method. Subpixel methods are also particularly sensitive to noise in the images, and the utility of a particular algorithm is distinguished not only by its speed and accuracy but its resilience to the particular types of noise in the application.

Rationale The method is based on the Fourier shift theorem. Let the two images ga and gb be circularly-shifted versions of each other:

gb(x,y) =def ga((x−Δx)modM,(y−Δy)modN) (where the images are M×N in size). Then, the discrete Fourier transforms of the images will be shifted relatively in phase:

𝐆b(u,v)=𝐆a(u,v)e−2πi(uΔxM+vΔyN) One can then calculate the normalized cross-power spectrum to factor out the phase difference:

R(u,v)=𝐆a𝐆b∗|𝐆a𝐆b∗|=𝐆a𝐆a∗e2πi(uΔxM+vΔyN)|𝐆a𝐆a∗e2πi(uΔxM+vΔyN)|=𝐆a𝐆a∗e2πi(uΔxM+vΔyN)|𝐆a𝐆a∗|=e2πi(uΔxM+vΔyN) since the magnitude of an imaginary exponential always is one, and the phase of 𝐆a𝐆a∗ always is zero. The inverse Fourier transform of a complex exponential is a Dirac delta function, i.e. a single peak:

r(x,y)=δ(x+Δx,y+Δy) This result could have been obtained by calculating the cross correlation directly. The advantage of this method is that the discrete Fourier transform and its inverse can be performed using the fast Fourier transform, which is much faster than correlation for large images.

Benefits Unlike many spatial-domain algorithms, the phase correlation method is resilient to noise, occlusions, and other defects typical of medical or satellite images. The method can be extended to determine rotation and scaling differences between two images by first converting the images to log-polar coordinates. Due to properties of the Fourier transform, the rotation and scaling parameters can be determined in a manner invariant to translation.

… excerpt ends here. Continue reading the full article.

Worked examples

Example 1 — a first encounter with Phase correlation

Start with the simplest possible case. Write down what Phase correlation claims or describes in one sentence, then invent the smallest concrete situation in which that sentence is true. In computer science, the smallest case is usually a single object, a single equation or a single measurement. Check that every symbol or term in your sentence has a meaning in that case.

Example 2 — changing one variable

Take the situation from Example 1 and change exactly one quantity: double it, halve it, or set it to zero. Predict what should happen to Phase correlation before you calculate. Comparing your prediction with the result is the fastest way to find out whether you understand the idea or only the words.

Example 3 — an exam-style question

Typical questions about Phase correlation ask you to (a) state it precisely, (b) apply it to given data, and (c) explain a limitation. Practise writing all three answers in under five minutes; the third part is what separates a full-mark answer from an average one.

Applications of Phase correlation

In research
Phase correlation appears in computer science research whenever the underlying quantities have to be modelled precisely. Papers usually cite it as a starting assumption and then explore where it breaks down.
In technology and industry
Engineering practice reuses Phase correlation in design rules, simulations and safety margins. Knowing the idea lets you read a specification sheet and understand why the numbers look the way they do.
In the classroom
Phase correlation is common in secondary-school and first-year university syllabi. It links to neighbouring topics Computer vision, so understanding it makes those chapters shorter.
In everyday life
Look for Phase correlation outside the textbook — in sport, cooking, traffic, electronics or the sky above you. An example you found yourself is remembered far longer than one you were given.
Ask Teacher Smith questions about this articleOpens your AI tutor with a question about “Phase correlation” →

How to study Phase correlation in 20 minutes

  1. Read the reference excerpt below once, without taking notes.
  2. Close the page and write down what Phase correlation means in your own words.
  3. Compare your version with the excerpt and mark what you missed.
  4. Work through the three examples above with pen and paper.
  5. Explain Phase correlation out loud to somebody else — or to Teacher Smith in the lgStudy chat.

Frequently asked questions

What is Phase correlation in simple terms?

Phase correlation is an approach to estimate the relative translative offset between two similar images (digital image correlation) or other data sets. It is commonly used in image registration and relies on a frequency-domain representation of the data, usually calculated by fast Fourier transform…

Why does Phase correlation matter?

Because it connects several computer science ideas at once: it gives you a definition you can apply, a quantity you can calculate, and a way to check whether a result is plausible.

How should I study Phase correlation?

Read the excerpt, restate it from memory, then work through the examples and applications listed on this page. The five-step study plan above takes about twenty minutes.

What does this page cover?

It gives you a compact reference excerpt plus original lgStudy explanations, examples, applications and study material on Phase correlation.

Tags

  • Computer vision

Keep exploring