Drexel dragonThe Math ForumDonate to the Math Forum



Search All of the Math Forum:

Views expressed in these public forums are not endorsed by Drexel University or The Math Forum.


Math Forum » Discussions » Software » comp.soft-sys.matlab

Topic: How to calculate the angle between two images?
Replies: 41   Last Post: Dec 8, 2012 11:02 PM

Advanced Search

Back to Topic List Back to Topic List Jump to Tree View Jump to Tree View   Messages: [ Previous | Next ]
Dave Robinson

Posts: 1,338
Registered: 1/25/05
Re: How to calculate the angle between two images?
Posted: Apr 7, 2009 12:11 PM
  Click to see the message monospaced in plain text Plain Text   Click to reply to this topic Reply

"khoo" <jim_khoo@hotmail.com> wrote in message <grflih$arh$1@fred.mathworks.com>...
> Bro Dave, pls continue to teach me..i dun wan give up with this method in half way...now only you can help me..i already email the mfile to your email...i now dunno my code wrong where and izit i get the correct final graph or not?? and why different angle image still show the same radian..

There is good news and there is bad news.

The good news is I have run your two images through my own software which effectively does the process that you are trying to do, and as I had originally thought, the information regarding your rotation angle is there good and clear. The problem you are having is due to image edge, and aliasing problems. Look at your two histograms im6 & im7 by plotting them, what you should see is a nice relatively smooth almost Gaussian curve, which peaks in a totally different place in both graphs this is the information regarding the rotation. However in addition you have some very large spikes occurring in exactly the same position on both graphs ( at 0 and 90 degrees etc.). When you do your FFT based correlation, these spikes give you the 'same radian' reading that you are observing. You need to remove them from your original histograms before you do your FFT correlation.

Think carefully how you do this, you cannot simply set those angles to zero as this will will introduce spikes going in the other direction, towards zero, not towards a bigger number. You essentially need to replace them with the 'average' value of the smooth curve around them, so it looks continuous.

I can make a suggestion that you do some research on a 1 dimensional median filter, which should do exactly what you want. Don't try and smooth the curve - that just don't work.

Unfortunately spending so much time with this thread I am getting behind with my own work. I am afraid I am going to have to leave you to do the final steps (don't worry about zero packing - that is just a cosmetic step to increase the resolution of the angle measurement). You now know the data you are seeking is there, all you need is the removal of the spikes and away you go. I urge you to look at those histograms. As far as I can see your code is more or less OK.

Regards

Dave Robinson


Date Subject Author
4/3/09
Read How to calculate the angle between two images?
khoo
4/3/09
Read Re: How to calculate the angle between two images?
Dave Robinson
4/3/09
Read Re: How to calculate the angle between two images?
khoo
4/3/09
Read Re: How to calculate the angle between two images?
Dave Robinson
4/3/09
Read Re: How to calculate the angle between two images?
khoo
4/3/09
Read Re: How to calculate the angle between two images?
Dave Robinson
4/3/09
Read Re: How to calculate the angle between two images?
khoo
4/3/09
Read Re: How to calculate the angle between two images?
khoo
4/4/09
Read Re: How to calculate the angle between two images?
khoo
4/4/09
Read Re: How to calculate the angle between two images?
Dave Robinson
4/4/09
Read Re: How to calculate the angle between two images?
khoo
4/4/09
Read Re: How to calculate the angle between two images?
khoo
4/5/09
Read Re: How to calculate the angle between two images?
khoo
4/5/09
Read Re: How to calculate the angle between two images?
Dave Robinson
4/5/09
Read Re: How to calculate the angle between two images?
khoo
4/5/09
Read Re: How to calculate the angle between two images?
khoo
4/5/09
Read Re: How to calculate the angle between two images?
Dave Robinson
4/5/09
Read Re: How to calculate the angle between two images?
khoo
4/6/09
Read Re: How to calculate the angle between two images?
khoo
4/6/09
Read Re: How to calculate the angle between two images?
Dave Robinson
4/6/09
Read Re: How to calculate the angle between two images?
khoo
4/6/09
Read Re: How to calculate the angle between two images?
Dave Robinson
4/6/09
Read Re: How to calculate the angle between two images?
khoo
4/6/09
Read Re: How to calculate the angle between two images?
Dave Robinson
4/6/09
Read Re: How to calculate the angle between two images?
khoo
4/6/09
Read Re: How to calculate the angle between two images?
khoo
4/6/09
Read Re: How to calculate the angle between two images?
khoo
4/7/09
Read Re: How to calculate the angle between two images?
khoo
4/7/09
Read Re: How to calculate the angle between two images?
khoo
4/7/09
Read Re: How to calculate the angle between two images?
Dave Robinson
12/8/12
Read Re: How to calculate the angle between two images?
Jeff
4/3/09
Read Re: How to calculate the angle between two images?
Skeptic
4/3/09
Read Re: How to calculate the angle between two images?
Dave Robinson
4/3/09
Read Re: How to calculate the angle between two images?
Roger Stafford
4/3/09
Read Re: How to calculate the angle between two images?
khoo
4/3/09
Read Re: How to calculate the angle between two images?
Roger Stafford
4/3/09
Read Re: How to calculate the angle between two images?
ImageAnalyst
4/3/09
Read Re: How to calculate the angle between two images?
khoo
4/4/09
Read Re: How to calculate the angle between two images?
khoo
4/6/09
Read Re: How to calculate the angle between two images?
Matt
4/6/09
Read Re: How to calculate the angle between two images?
khoo
4/6/09
Read Re: How to calculate the angle between two images?
Matt

Point your RSS reader here for a feed of the latest messages in this topic.

[Privacy Policy] [Terms of Use]

© Drexel University 1994-2014. All Rights Reserved.
The Math Forum is a research and educational enterprise of the Drexel University School of Education.