Path: news.mathworks.com!not-for-mail
From: "Prasanna " <pmgunawardana@gmail.com>
Newsgroups: comp.soft-sys.matlab
Subject: Re: Template matchine with binary image
Date: Mon, 9 Nov 2009 18:39:04 +0000 (UTC)
Organization: university of colombo
Lines: 13
Message-ID: <hd9nk7$50c$1@fred.mathworks.com>
References: <hd8n5u$au1$1@fred.mathworks.com> <46a9efa9-2038-421f-a08a-7375c8a5925e@s15g2000yqs.googlegroups.com>
Reply-To: "Prasanna " <pmgunawardana@gmail.com>
NNTP-Posting-Host: webapp-05-blr.mathworks.com
Content-Type: text/plain; charset="ISO-8859-1"
Content-Transfer-Encoding: 8bit
X-Trace: fred.mathworks.com 1257791944 5132 172.30.248.35 (9 Nov 2009 18:39:04 GMT)
X-Complaints-To: news@mathworks.com
NNTP-Posting-Date: Mon, 9 Nov 2009 18:39:04 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 1752223
Xref: news.mathworks.com comp.soft-sys.matlab:583614


Thanks 4 replying. Below display the template matching code that I wrote. I did this using several demos those are in the MATLAB 2008a version. Here "someblobsI" means the binary image. "Icropped" means the template(which is also binary). no rotations and scalings happenning to both image and the template. Is this code relevant to my application or should I change something here?


C = real(ifft2(fft2(someblobsI) .* fft2(rot90(Icropped,2),480,640))); 

figure, imshow(C,[]);
max(C(:))

thresh = 1000 ; % Use a threshold that's a little less than max.
figure, imshow(C > thresh); % identification

regards
Prasanna