Search All of the Math Forum:

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

Notice: We are no longer accepting new posts, but the forums will continue to be readable.

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

 Messages: [ Previous | Next ]
 khoo Posts: 63 Registered: 8/9/08
Re: How to calculate the angle between two images?
Posted: Apr 5, 2009 9:54 AM

> > the max_angle i find is 1 every time..but when i check im8 value, got other value max than 1..so how i need to do the find the peak value?
>
> The correlation you should get from doing the Re(IFFT ....) is a one dimensional graph, whereas the max(max... you are applying is for a 2 dimensional matrix.
>
> Try to plot what you have called im8 and see if you end up with a graph showing a peak.
>
> When I try to access your image I get a message indicating it has been deleted or removed.

> > Sorry about your dead line, but it is Sunday here, and it is only just luck I caught this mail, as I have family responsibilities to deal with on a weekend.
>
> Good Luck & Regards

>
> Dave Robinson

Bro Dave, this is the code i do until currently...the max value i find is very large...i no sure i got do what wrong o not...but pls teach me how to find the correct angle..

clear all;clc

im11=rgb2gray(im1);
im111=im2double(im11);
p1=atan2(dy,dx);
im1111=edge(p1,'canny');
bw1 = bwmorph(im1111,'dilate');
im11111=p1.*bw1;
im6=hist(im11111);
im66=fft(im6);

im2=imresize(im,size(im11),'bicubic');
im22=rgb2gray(im2);
im222=im2double(im22);
p2=atan2(dy,dx);
im2222=edge(p2,'canny');
bw2 = bwmorph(im2222,'dilate');
im22222=p2.*bw2;
%subplot(2,1,2);hist(im22222);
im7=(hist(im22222));
im77=conj(fft(im7));
im8=real(ifft(im66.*im77));
im9=transform(im8);
max_value=max(im9)
hist(im8);

below is the function i try to convert the image to 1 Dimensional matric
function b=transform(a)

[row,column]=size(a);
b=[];

for i=1:row
for j=1:column
b=[b a(i,j)];
end
end

Date Subject Author
4/3/09 khoo
4/3/09 Dave Robinson
4/3/09 khoo
4/3/09 Dave Robinson
4/3/09 khoo
4/3/09 Dave Robinson
4/3/09 khoo
4/3/09 khoo
4/4/09 khoo
4/4/09 Dave Robinson
4/4/09 khoo
4/4/09 khoo
4/5/09 khoo
4/5/09 Dave Robinson
4/5/09 khoo
4/5/09 khoo
4/5/09 Dave Robinson
4/5/09 khoo
4/6/09 khoo
4/6/09 Dave Robinson
4/6/09 khoo
4/6/09 Dave Robinson
4/6/09 khoo
4/6/09 Dave Robinson
4/6/09 khoo
4/6/09 khoo
4/6/09 khoo
4/7/09 khoo
4/7/09 khoo
4/7/09 Dave Robinson
12/8/12 Jeff
4/3/09 Skeptic
4/3/09 Dave Robinson
4/3/09 Roger Stafford
4/3/09 khoo
4/3/09 Roger Stafford
4/3/09 ImageAnalyst
4/3/09 khoo
4/4/09 khoo
4/6/09 Matt
4/6/09 khoo
4/6/09 Matt