Path: news.mathworks.com!not-for-mail
From: <HIDDEN>
Newsgroups: comp.soft-sys.matlab
Subject: Re: hello
Date: Wed, 21 Oct 2009 14:47:04 +0000 (UTC)
Organization: Helbling Technik Bern AG
Lines: 20
Message-ID: <hbn6t8$mfb$1@fred.mathworks.com>
References: <hbn5ki$7t$1@fred.mathworks.com>
Reply-To: <HIDDEN>
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 1256136424 23019 172.30.248.38 (21 Oct 2009 14:47:04 GMT)
X-Complaints-To: news@mathworks.com
NNTP-Posting-Date: Wed, 21 Oct 2009 14:47:04 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 1271984
Xref: news.mathworks.com comp.soft-sys.matlab:579013


"liong " <khliong_1986@yahoo.com> wrote in message <hbn5ki$7t$1@fred.mathworks.com>...
> i am doing the project on eye detection by using template matching by finding the similarity value between the sample and image.
> 
> 
> for i= 1: 120; 
>     for j= 1:120;
>         (i,j)= bw2(i,j)- t(i,j) #
>     end 
>       end 
> 
> A= 1- (sum(sum(n))/(120*120*255*3));  
> 
> where t is template and bw2 is sample and A is the similarity function between the template and sample. But the error is happen at the row #...can anyone tell me about this? please...i need your help. and i will appreaciate it..

1. use more explicit subjects for your posts
2. the line (i,j)= bw2(i,j)- t(i,j) cannot work. (i,j) is an indexing, it has to be applied to a matrix, like AA(i,j) = bw2(i,j)- t(i,j) 
3. all your for loop does basically AA=bw-t --> DO NOT USE A FOR LOOP!
4. I'm not exactly sure I understood what you're trying to do. However, what you ARE doing is just substracting a matrix from another one.

If I guess correctly, you are trying to find in which location the image bw2 has the highest correlation with the image t? in this case, you have to substract the local subset of the image bw to the reference image t.