Path: news.mathworks.com!newsfeed-00.mathworks.com!NNTP.WPI.EDU!elk.ncren.net!newsflash.concordia.ca!canopus.cc.umanitoba.ca!not-for-mail
From: roberson@ibd.nrc-cnrc.gc.ca (Walter Roberson)
Newsgroups: comp.soft-sys.matlab
Subject: Re: Template Matching
Date: Mon, 7 Apr 2008 16:55:44 +0000 (UTC)
Organization: National Research Council Canada - Conseil national de rechereches Canada
Lines: 43
Message-ID: <ftdjmg$jms$1@canopus.cc.umanitoba.ca>
References: <fsnera$t69$1@fred.mathworks.com> <b725e021-4633-4de8-ad57-abd4fcd9e27c@m36g2000hse.googlegroups.com> <36d513fb-3cc7-49e7-8397-3b3fefc79825@j1g2000prb.googlegroups.com> <ftco07$9sl$1@fred.mathworks.com>
NNTP-Posting-Host: origin.ibd.nrc.ca
X-Trace: canopus.cc.umanitoba.ca 1207587344 20188 192.70.172.160 (7 Apr 2008 16:55:44 GMT)
X-Complaints-To: abuse@cc.umanitoba.ca
NNTP-Posting-Date: Mon, 7 Apr 2008 16:55:44 +0000 (UTC)
Originator: roberson@ibd.nrc-cnrc.gc.ca (Walter Roberson)
Xref: news.mathworks.com comp.soft-sys.matlab:461553


In article <ftco07$9sl$1@fred.mathworks.com>,
Dave Robinson <dave.robinson@somewhere.biz> wrote:
>androalpha_v7@yahoo.com wrote in message <36d513fb-3cc7-
>49e7-8397-3b3fefc79825@j1g2000prb.googlegroups.com>...

>> A=image(image of any ships)
>> B=subimage (containing number assigned to a ship)

>For your application you DO NOT want to stretch your images 
>to the same size. It is essential that the spatial scale 
>between your search image and template remain fixed. Using 
>Walter's technique will change the scaling of your 
>template, so you will no longer be able to find a match 
>between the template and the Search Image. 

>What you have to do is embed your template image into a 
>blank frame, so that if you view the resulting buffered 
>image you see your template, the same size as it started 
>and a large region of black pixels. Walters suggestions 
>will essentially fill your buffer with a scaled version of 
>your template. 

I am confused about which is the "template" image in this
situation. It seems to me that the "template" is image B,
which I -gather- is a high-resolution ship number, with it
being necessary to find test the ship number against image A
in order to attempt to recognize which ship is present in image A.
But if these thoughts are true, then if image A got resized
to larger, then it would not be the -template- that got
embedded in a frame, or the -template- that got scaled, it would
be the image of the ship. And it seems to me that if the component
relationship I have described is what the original poster intended,
then either no rescaling is needed at all or else the scaling required
would be such that one would blow up the image of the ship so that
the ship number assumed the same scale as the template, thus requiring
that the ship image be blown up to noticably -larger- than the template.
(Which at least might solve the aspect ratio issues.)

But I haven't done any template matching, and I am not certain I
have understood properly what A and B are.
-- 
  "Eightly percent of the people in the world are fools and the
  rest of us are in danger of contamination." -- Walter Matthau