Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>You could simply use run-of-the-mill 2D cross correlation and detect where the maximum value lies to determine the (x,y) offset. Following the <a href="http://mathworld.wolfram.com/Cross-CorrelationTheorem.html" rel="nofollow">Cross-correlation theorem</a> you can efficiently implement this in the Fourier domain. </p> <p>See this simple example in Matlab on github, <a href="https://github.com/mdiephuis/sandbox/blob/master/so/m_xcorr2.m" rel="nofollow">cross correlation</a> and <a href="https://github.com/mdiephuis/sandbox/blob/master/so/m_translation_offset.m" rel="nofollow">peak finding</a></p> <p>EDIT</p> <p>Here follows the short and mostly incomplete guide to the <em>rigid registration</em> of images. The gist of the cross correlation idea is as follows: Say I have a 1D vector:</p> <p><code>t = [1 2 3 1 2 3 4 ]</code></p> <p>I shift this vector -4 places resulting in a new vector <code>t2</code>:</p> <p><code>t2 = [2 3 4 1 2 3 1]</code></p> <p>Now I have a look at the so called cross correlation <code>c</code> between <code>t</code> and <code>t2</code>:</p> <p><code>c = [1 5 11 15 17 25 38 37 28 24 29 18 8]</code></p> <p>Now, this cross correlation vector has a maximum of <code>38</code> located on position or index <code>7</code>. This we can use to ascertain the shift as follows:</p> <p><code>offset = round((7-(length(c)+1))/2)</code></p> <p><code>offset = -4</code></p> <p>where <code>length()</code> gives the dimensionality or number of elements in this dimension, of the cross correlation result.</p> <p>Now, as should be evident, the cross correlation in the Spacial domain requires a lot of operations. This is where the above mentioned <a href="http://mathworld.wolfram.com/Cross-CorrelationTheorem.html" rel="nofollow">cross-correlation theorem</a> comes in to play which links correlation in the Spacial domain to multiplication in the Fourier domain. The fourier transform is blessed with a number of very fast implementations (FFT) requiring vastly less operations, hence the reason they are used for determining the cross correlation.</p> <p>There are many methods that deal with so-called rigid registration from stitching of satellite and holiday images a like to overlaying images from different sources as often found in medical imaging applications. </p> <p>In your particular case, you might want to have a look at <a href="http://en.wikipedia.org/wiki/Phase_correlation" rel="nofollow">Phase correlation</a>. Also the <a href="http://www.nr.com/oldverswitcher.html" rel="nofollow">Numercial recipes in c book</a> contains a chapter on fourier and correlation. </p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload