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 ]
khoo

Posts: 63
Registered: 8/9/08
Re: How to calculate the angle between two images?
Posted: Apr 6, 2009 4:25 AM
  Click to see the message monospaced in plain text Plain Text   Click to reply to this topic Reply

> Why on earth are you trying to convert an image into a 1 dimensional vector? you are correlating 2 histograms - histograms are essentially graphs - in your case angle along the x axis, number of pixels of that angle in y direction. If you have say 256 angles, then each bin represents (2*pi)/256 radians. Thus the histogram will be a vector of 256 numbers, each number representing the number of pixels of that angle.
>
> I suggest you carefully read help hist(), doesn't that default to 10 bins - you will need to have much better resolution than that.
>
> I have had a look at your images, and would have thought they were ideally suited to this methodology.
>
> Regards
>
> Dave Robinson


Bro Dave, this is my code currently...and i ady change the hist not to default 10 binsand set to 256..


clear all;clc

im1=imread('image1.jpg');
im11=rgb2gray(im1);
im111=im2double(im11);
[dx,dy]=gradient(im111);
p1=atan2(dy,dx);
im1111=edge(p1,'canny');
bw1 = bwmorph(im1111,'dilate');
im11111=p1.*bw1;
im6=hist(im11111(:),256);
im66=fft(im6);

im2=imread('image2.jpg');
im22=rgb2gray(im2);
im222=im2double(im22);
im333=zeros(size(im111));
im333(1:size(im2,1),1:size(im2,2))=im222;
[dx,dy]=gradient(im333);
p2=atan2(dy,dx);
im2222=edge(p2,'canny');
bw2 = bwmorph(im2222,'dilate');
im22222=p2.*bw2;
im7=hist(im22222(:),256);
im77=conj(fft(im7));
im99=im66.*im77;
im8=real(ifft(im66.*im77));
XXX=hist(im8(:),256);
stem(1:256,XXX, 'Marker', 'none');

and this is my new image2..
http://i278.photobucket.com/albums/kk119/khoo011/image2-1.jpg

just now i check all the histogram for the im11111 and im22222..all is correct..but once i fft the both histograms..when i inverse the FFT..the histogram cannot inverse and still stay in FFt mode...can you help me check my code got any problem ? and teach me how to fix the problem..so far i find the peak is at left side which is after FFT..


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.