Path: news.mathworks.com!not-for-mail
From: "khoo" <jim_khoo@hotmail.com>
Newsgroups: comp.soft-sys.matlab
Subject: Re: How to calculate the angle between two images?
Date: Mon, 6 Apr 2009 14:48:01 +0000 (UTC)
Organization: haha
Lines: 43
Message-ID: <grd4n1$ppi$1@fred.mathworks.com>
References: <gr4ten$oks$1@fred.mathworks.com> <gr4u55$add$1@fred.mathworks.com> <gr4v19$60a$1@fred.mathworks.com> <gr82h2$d9h$1@fred.mathworks.com> <gr86ie$m8l$1@fred.mathworks.com> <gr96k1$cgv$1@fred.mathworks.com> <gra0s1$7d0$1@fred.mathworks.com> <gra1tq$a1t$1@fred.mathworks.com> <grad5q$cai$1@fred.mathworks.com> <graed8$ope$1@fred.mathworks.com> <grce8v$8g$1@fred.mathworks.com> <grcfva$cbd$1@fred.mathworks.com> <grcqo9$17e$1@fred.mathworks.com> <grcro9$209$1@fred.mathworks.com> <grd1c5$mk8$1@fred.mathworks.com> <grd3p1$oph$1@fred.mathworks.com>
Reply-To: "khoo" <jim_khoo@hotmail.com>
NNTP-Posting-Host: webapp-03-blr.mathworks.com
Content-Type: text/plain; charset="ISO-8859-1"
Content-Transfer-Encoding: 8bit
X-Trace: fred.mathworks.com 1239029281 26418 172.30.248.38 (6 Apr 2009 14:48:01 GMT)
X-Complaints-To: news@mathworks.com
NNTP-Posting-Date: Mon, 6 Apr 2009 14:48:01 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 1113304
Xref: news.mathworks.com comp.soft-sys.matlab:530761

> > Bro Dave, when i rotate the images, i don't think the actual image boundaries will rotate...ABout the other spikes bear, i no sure about it but how to set the zero degree spike  to zero??
> 
> im8(0) = 0;
> 
> Maybe
> 
> Regards
> 
> Dave Robinson

Bro Dave, still cannot...this is my currently code after i set zero spike to zero...but the graph still like the graph i get jz now..


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));
im8=real(ifft(im66.*im77));
plot(im8)
im8(1)=0;

izit my FFT there got problem?? cause normally FFT graph, the peak will at left side..but after IFFT the graph should be back like before FFT..but my graph's peak still at left side..can help me check my code got wrong at anywhere??