khoo
Posts:
63
Registered:
8/9/08


Re: How to calculate the angle between two images?
Posted:
Apr 4, 2009 10:56 PM


> > bro, i no understand wat this mean?? and how to extend the spctra by zero packing??can explain and teach me? > > Doing it at matching points, as Roger suggests is one good way of doing it, however unless you have ImageAnalysts point 2) problem, this shouldn't be necessary. However without seeing your images  it is difficult to say. > > First consider your two histograms, these represent the number of meaningful angle pixels binned into a 'x axis' position representing an angle. The complete x axis of the histogram represents an angle of 0 >2pi. as your image rotates, so the predominant edges will rotate by that angle, and thus comparing the two histograms, what you should see is the same general pattern in both histograms but being shifted one way or other by their relative rotation angle, as measured on the x axis of the histograms. > > Now ignoring zero packing for a moment, if you do see this general similarity, then one way to find the angle of offset is by applying correlation, not to the images but to the histograms themselves. > > Fast convolution using the FFT is particularly suited for this operation as bot FFT correlation, and the histograms themselves can be considered cylindrical, namely details that get shifted say left off of the histogram don't get lost  they reappear at the right side of the histogram, (remember we are on an angular scale) FFT correlation has exactly the same effect, and normally you have to work like blazes to remove the wrap around effect from your computation, here it is just what we want. > > The computation itself should be easy, simply FFT both histograms  remember this results in complex answers  don't throw away the phase, do complex arithmetic for the next phase which is > > multiply the spectrum of one histogram by the complex conjugate of the second spectrum (remember to .* not *) then find the real part of the inverse transform of the product. > > Look at this resulting vector, and hopefully you should find a peak value corresponding to the relative rotation angle between the two images. If you do, come back and we will discuss the zero packing to get better angular resolution, if not then we need to see the type of image you are working with. > > Regards > > Dave Robinson
bro Dave, pls help fast..today is my last day to complete oit ady...pls help me...urgent..

