Prev: position/orientation question
Next: barcode reader
From: Divya on 4 May 2010 01:57 I am trying to code the following algorithm Algorithm Input: Two overlapping images I1 and I2 Output: Registration parameters (tx, ty, θ) where tx and ty are translation in x and y directions respectively and θ is the rotation parameter. Steps: 1. Down sample the 2 images by 2 levels. Let the sampled images be I1' and I2' 2. For i = 1: step: 360 //step could be 1, 2 or 5 2.1) Rotate I2 ' by i degrees. Let the rotated image be I2'rot. 2.2) Compute the Fourier transforms FI1' and FI2'rot of images I1' and I2 'rot respectively. 2.3) Let Q(u, v) be the Phase correlation value of I1' and I2'rot, based on FI1' and FI2'rot Q(u,v)= FI1'(u,v).FI2'rot(u,v)/ | FI1'(u,v).FI2'rot(u,v)| 2.4) Compute the inverse Fourier transform q(x, y) of Q(u, v). 2.5) Locate the peak of q(x, y). 2.6) Store the peak value in a vector at position i. End For 3. Find the index of maximum peak from the values stored in the vector in step 2.6. It gives the angle of rotation. Let it be θ'. 4. Repeat steps 2.1 to 2.6 for i = θ' -step: θ' +step. 5. Find the angle of maximum peak from step 4. It becomes the angle of rotation. Let it be θ. 6. Rotate the original image I2 by ‘θ’. Let the rotated image be I2rot. 7. Phase correlate I1 and I2rot. Let the result be P(u, v). 8. Compute the inverse Fourier transform p(x, y) of P(u, v). 9. Locate the position (tx, ty) of the peak of p(x, y) which become the translation parameters. 10.Output the parameters (tx, ty, θ). I am having trouble in step 2 Also how do we down sample an image?
From: Image Analyst on 4 May 2010 08:50 "Divya " <divs.raghavan(a)gmail.com> wrote in message <hrocvf$r7k$1(a)fred.mathworks.com>... [snip] > Also how do we down sample an image? ------------------------------------------------------ You can downsize an image with imresize().
|
Pages: 1 Prev: position/orientation question Next: barcode reader |