|
"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.
|