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 3, 2009 12:29 PM
  Click to see the message monospaced in plain text Plain Text   Click to reply to this topic Reply

> > > Now you need to make 2 histograms (one from each of your angle images) of your trusted angles. What you find is that these histograms are virtually identical, with the exception that they are shifted relative to each other. This shift is equal to the relative rotation of the original images.
> > >

> >
> > i ady done the in front part but stuck at the modified edge image over corresponding angle..i dunno wat function need to be used..i using time but got error..
> >
> > this is the code i currently obtained so far
> >
> > 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');
> > im=p1*bw1;
> > imshow(im)
> >
> > this is the error messange i got
> > ??? Error using ==> mtimes
> > Inner matrix dimensions must agree.
> >
> > so wat the function i need to used??

>
> I am a bit busy to study your code closely right at the moment, but what seem to be a problem is
> im=p1*bw1;
> I would have thought that it should read
> im=p1.*bw1;
>
> The dot before the * is kind of crucial check the help files.
>
> By the way I am impressed with the speed at which you converted my description into code, it might not have worked first time, but this is the only way to really get to grips with a very powerful problem solving tool
>
> Well done
>
> Dave Robinson



now i ady done until get the histogram, but how to get the angle between two image?? i no understand this statement

What you find is that these histograms are virtually identical, with the exception that they are shifted relative to each other. This shift is equal to the relative rotation of the original images.

this is my code currently..i dunno how to find the angle out between two image....

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;
[max_angle1]=find(max(max(im11111)));
subplot(2,1,1);hist(im11111)


im2=imread('image2.jpg');
im22=rgb2gray(im2);
im222=im2double(im22);
[dx,dy]=gradient(im222);
p2=atan2(dy,dx);
im2222=edge(p2,'canny');
bw2 = bwmorph(im2222,'dilate');
im22222=p2.*bw2;
[max_angle2]=find(max(max(im22222)));
subplot(2,1,2);hist(im22222)

the max angle i try find for each image..but all is same...is 1..what i need to do next??


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.