hi everyone..
i have need help on template matching. i have an image that
need to be match with 3 subimage(template images).can anyone
teach me on the coding in Matlab
On Mar 30, 3:18=A0am, "akane ajibana" <androalpha...@yahoo.com> wrote:
> hi everyone..
> i have need help on template matching. i have an image that
> need to be match with 3 subimage(template images).can anyone
> teach me on the coding in Matlab
------------------------------------------------
akane:
Just scan it across your image (using 2 nested for loops). Hit every
pixel in the image multiplying the image under the template by your
template. Check to see if it attains the value it should if your
image exactly matched your template. You might be able to send your
template and your image into the conv2() function and avoid the nested
for loops. Are you using a gray scale image, binary image, color
image, or 3D volume image?
What exactly have you tried yet? Post your code. Post images if you
can.
Regards,
ImageAnalyst
androalpha_v7@yahoo.com wrote in message <5bd63180-92b7-
401f-acac-fe5c63f19d7d@q27g2000prf.googlegroups.com>...
> thanx ImageAnalyst;
>
> the image i will use is in grayscale..
> can u all suggest the other matching 2 image techique
that available
> in MAtlab
Providing that the subimages you are searching for do not
rotate, and are the same scale as your templates, then
probably an efficient way of doing what you want is to use
fast correlation.
Take your three template images, and place them in a blank
frame which has the same size as the image you are scanning.
Do a 2D fast Fourier transform on your search image, and
your three buffered template images. Multiply pixel by
pixel (.*) the Fourier domain version of your search image
(remember these will be complex numbers) by the complex
conjugate of the Fourier transforms of your buffered
template images inturn. The inverse transform of these
three product transforms which will show a bright spot at
the point where your template exists within your search
image.
If your target position is close to the edge, then you
should increase the size of your 'blank buffer' frames to
m+n-1 where m is the size of your search image, and n is
the size of your templates. In this case embed your search
image into an identical buffer frame.
From memory I think that the Filter operation (imfilt()?)
in the image toolbox does this complete operation for you,
but you must remember to set the operation to undertake
correlation - not convolution.
androalpha_v7@yahoo.com wrote in message <60ed041e-aaaa-
43b5-aa08-876e61f69f74@r9g2000prd.googlegroups.com>...
> can i do the correlation if the template and original
image is in
> different size?
Yes, using the scanning method outlined by one of the
previous helpers (or a method that hides the image
buffering from you).
The Fast Fourier transform has the property of generating a
complex array with the same number of elements as the image
has pixels. You need to multiply two Transforms
together 'pixel by pixel' - it therefore follows that the
number of elements in your search image transform must be
the same as the number of elements in your template
transform array. Clearly there is an apparent problem
between these two observations when the template is a
different size to your search image. However this is
trivially dealt with by creating an empty buffer whose size
is the same as the search image (or bigger - see my earlier
comments) using something like 'zeros(y,x)' then simply
copy your template image into the top left hand corner of
the blank buffer, then proceed as suggested.
"akane ajibana" <androalpha_v7@yahoo.com> wrote in message
<fsnera$t69$1@fred.mathworks.com>...
> hi everyone..
> i have need help on template matching. i have an image that
> need to be match with 3 subimage(template images).can anyone
> teach me on the coding in Matlab
The images cannot be different sizes so you will have to pad
out the smaller image with zeros to make it the same size.
The images must also be square.
% fourier transform both images
fi = fft2(i);
fr = fft2(ref);
% perform phase correlation (amplitude is normalized)
fc = fi .* conj(fr);
fcn = fc ./ abs(fc);
c = real(ifft2(fcn));
% find the peak in the correlation plane
[v index] = max(c(:));
[y x] = ind2sub(siz,index);
% invert quadrants due to fft shift
mid = siz(1) / 2;
y = y - sign(y-mid-0.5) * mid;
x = x - sign(x-mid-0.5) * mid;
androalpha_v7@yahoo.com wrote in message
<517f4bf4-8260-497e-b194-c7abe5c92080@a9g2000prl.googlegroups.com>...
>
> How have to pad out the smaller image with zeros to make it
> so that the image in same size. ?
a is the square small image, b is the square large image, c
is the zero padded image of a
In article <647eb1a7-98ee-4b77-9d3a-6b42906c15e2@j1g2000prb.googlegroups.com>,
<androalpha_v7@yahoo.com> wrote:
>i have A image to expand the size of it so that it have same size with
>B image.
>A image =[38 51]
>B image=[423 800}
>so how to do it?
You have a problem that those two images do not have the same
aspect ratio. Therefor in order to expand the size of A, you
are either going to need to leave some empty space in the enlarged
image, or you are going to have to stretch the x and y axes
unequally.
There are several different image resizing algorithms, with
different properties. For example, some of the algorithms
concentrate on preserving sharp edges and some of them do not.
In your situation, what (if any) characteristics of the source image
are important to preserve in the enlarged image?
--
"He wove a great web of knowledge, linking everything together,
and sat modestly at a switchboard at the center, eager to help."
-- Walter Kerr
> There are several different image resizing algorithms, with
> different properties. For example, some of the algorithms
> concentrate on preserving sharp edges and some of them do not.
> In your situation, what (if any) characteristics of the source image
> are important to preserve in the enlarged image?
thanx walter for the advice..
A=image(image of any ships)
B=subimage (containing number assigned to a ship)
the idea of my assignment is like fingerprint recognition...but i want
to implement it using
matlab template matching..
so if the image contain the sbimage(no.assigned to ships)...then we
can say its match..
not only that..
i have other 2 subimage to match with A before i can say this image is
match...
androalpha_v7@yahoo.com wrote in message <36d513fb-3cc7-
49e7-8397-3b3fefc79825@j1g2000prb.googlegroups.com>...
> > There are several different image resizing algorithms,
with
> > different properties. For example, some of the
algorithms
> > concentrate on preserving sharp edges and some of them
do not.
> > In your situation, what (if any) characteristics of the
source image
> > are important to preserve in the enlarged image?
>
> thanx walter for the advice..
>
> A=image(image of any ships)
> B=subimage (containing number assigned to a ship)
>
> the idea of my assignment is like fingerprint
recognition...but i want
> to implement it using
> matlab template matching..
> so if the image contain the sbimage(no.assigned to
ships)...then we
> can say its match..
> not only that..
> i have other 2 subimage to match with A before i can say
this image is
> match...
>
> so do u have any idea?
>
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.
Pete Bone's response tells you how to do what you need.
In article <ftco07$9sl$1@fred.mathworks.com>,
Dave Robinson <dave.robinson@somewhere.biz> wrote:
>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.
You are not representing what I said accurately. What I wrote was,
>>You have a problem that those two images do not have the same
>>aspect ratio. Therefor in order to expand the size of A, you
>>are either going to need to leave some empty space in the enlarged
>>image, or you are going to have to stretch the x and y axes
>>unequally.
and I then proceeded to ask what characteristics were important
in the image expansion, so that we could figure out what kind
of expansion to use. Your "blank frame" option is the same as
my conditional "empty space" option, and my image magnification
option was accompanied by a warning that it would stretch the
axes unequally.
--
"It is surprising what a man can do when he has to, and how
little most men will do when they don't have to."
-- Walter Linn
roberson@ibd.nrc-cnrc.gc.ca (Walter Roberson) wrote in
message <ftdavl$7dc$1@canopus.cc.umanitoba.ca>...
> In article <ftco07$9sl$1@fred.mathworks.com>,
> Dave Robinson <dave.robinson@somewhere.biz> wrote:
>
> >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.
>
> You are not representing what I said accurately. What I
wrote was,
>
> >>You have a problem that those two images do not have
the same
> >>aspect ratio. Therefor in order to expand the size of
A, you
> >>are either going to need to leave some empty space in
the enlarged
> >>image, or you are going to have to stretch the x and y
axes
> >>unequally.
>
> and I then proceeded to ask what characteristics were
important
> in the image expansion, so that we could figure out what
kind
> of expansion to use. Your "blank frame" option is the
same as
> my conditional "empty space" option, and my image
magnification
> option was accompanied by a warning that it would stretch
the
> axes unequally.
Hi Walter
No critisism of your solution was meant, indeed it was a
full and valid explanation (as usual;-) of what the
original question you responded to asked.
I just got the impression that the guy had not understood
the help that had been provided with earlier postings, and
wanted to make sure that he wasn't flying off at a tangent.
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
seem i have cause a trouble here
so let me example
i have a image that have many type of fruit and vegetable..
i have a template image that have an image of apple..
both have the size i have mention before...
i have a problem to pad the template image
becoz after this i want to do the cross correlation between those two
image
as far as i know both image must have same size
so how to do it?
On Apr 8, 7:13 pm, Yumnam Kirani Singh <kirani.si...@gmail.com> wrote:
> Why so many stuffs on Template matching? It is almost the same as comparing two matrices for equality. Am I seriously wrong?
sorry about it...
i'm still working on template matching since i have no background
about matlab..
On Apr 8, 7:13 pm, Yumnam Kirani Singh <kirani.si...@gmail.com> wrote:
> Why so many stuffs on Template matching? It is almost the same as comparing two matrices for equality. Am I seriously wrong?
sorry about it...
i'm still working on template matching since i have no background
about matlab..
On Apr 8, 7:57=A0am, androalpha...@yahoo.com wrote:
> On Apr 8, 7:13 pm, Yumnam Kirani Singh <kirani.si...@gmail.com> wrote:
>
> > Why so many stuffs on Template matching? It is almost the same as compar=
ing two matrices for equality. Am I seriously wrong?
>
> sorry about it...
> i'm still working on template matching since i have no background
> about matlab..
>
> so please kindly advice me on this field..
Equality comparison doesn't take into account translations, rotations
and
scaling. Nor does it take into consideration the matching of a
subimage
with the template.
On Apr 8, 7:13=A0am, Yumnam Kirani Singh <kirani.si...@gmail.com> wrote:
> Why so many stuffs on Template matching? It is almost the same as comparin=
g two matrices for equality. Am I seriously wrong?
Yep, you are. Your concept works only in the most simple case. So
simple in fact that you'll never see it in the real world. It would
only happen in specially written simulations where you specifically
made it so. The real world will have situations as described in Greg
Heath's message, plus other things he didn't mention (but I'm sure
knows about) such as noise, partial occlusions (this is a very tough
complication, e.g. only part of the apple is visible), orientation
changes (e.g. you're trying to find apples and you have the bottom of
an apple in your image but your template is the side view of an
apple), different shapes/templates (e.g. find tanks given that there
are dozens of different models of tanks), color differences (apples
come in many different colors and color patterns), etc. In general
this can be a very tough problem - numerous people have gotten Ph.D.'s
in the subject. Or, if given as homework by a kind professor, it may
be crafted to be relatively simple.
Regards,
ImageAnalyst
> Yep, you are. Your concept works only in the most simple case. So
> simple in fact that you'll never see it in the real world. It would
> only happen in specially written simulations where you specifically
> made it so. The real world will have situations as described in Greg
> Heath's message, plus other things he didn't mention (but I'm sure
> knows about) such as noise, partial occlusions (this is a very tough
> complication, e.g. only part of the apple is visible), orientation
> changes (e.g. you're trying to find apples and you have the bottom of
> an apple in your image but your template is the side view of an
> apple), different shapes/templates (e.g. find tanks given that there
> are dozens of different models of tanks), color differences (apples
> come in many different colors and color patterns), etc. In general
> this can be a very tough problem - numerous people have gotten Ph.D.'s
> in the subject. Or, if given as homework by a kind professor, it may
> be crafted to be relatively simple.
Yes, you are right...everyone starting to talk to me saying that this
a basic concept.but
for me it's no easy to do it..
it's been a hard time for me to do it for the past 2 weeks...
i have about one week left to finish this...
so please any one...help me on this field
On Apr 8, 6:37=A0pm, androalpha...@yahoo.com wrote:
> > Yep, you are. =A0Your concept works only in the most simple case. =A0So
> > simple in fact that you'll never see it in the real world. =A0It would
> > only happen in specially written simulations where you specifically
> > made it so. =A0The real world will have situations as described in Greg
> > Heath's message, plus other things he didn't mention (but I'm sure
> > knows about) such as noise, partial occlusions (this is a very tough
> > complication, e.g. only part of the apple is visible), orientation
> > changes (e.g. you're trying to find apples and you have the bottom of
> > an apple in your image but your template is the side view of an
> > apple), different shapes/templates (e.g. find tanks given that there
> > are dozens of different models of tanks), color differences (apples
> > come in many different colors and color patterns), etc. =A0In general
> > this can be a very tough problem - numerous people have gotten Ph.D.'s
> > in the subject. =A0Or, if given as homework by a kind professor, it may
> > be crafted to be relatively simple.
>
> Yes, you are right...everyone starting to talk to me saying that this
> a basic concept.but
> for me it's no easy to do it..
> it's been a hard time for me to do it for the past 2 weeks...
> i have about one week left to finish this...
> so please any one...help me on this field
Well why don't you post some images and a template(s) so we know what
you're trying to find and where you need to look for it? Otherwise
you'll just have to make do with the general answers you've gotten so
far.
Regards,
ImageAnalyst
Thanx ImageAnalyst for concerning...
If u could give me yr emel than it will
much easier for me to post some image
so that you can take a look on it...
Since this a usenet group so it's impossible to post any image or file
If anyone interested with my project, please do tell me your e-mel
So that i can send u the files@image
akane <androalpha_v7@yahoo.com> wrote in message
<563ff25e-11bf-4619-b869-7f01c290dc94@v26g2000prm.googlegroups.com>...
> Since this a usenet group so it's impossible to post any
image or file
> If anyone interested with my project, please do tell me
your e-mel
> So that i can send u the files@image
>
> Please do help me
> akane
May I suggest that you instead use a free image hosting
service (such as http://imageshack.us/), rather than asking
for individual peoples' email. After you upload your
image(s), post a *detailed* description of what you are
trying to achieve, what you have succeeded with, and the
specific problems you now have.
I think people will be willing (and able) to help you if you
do this.
On Apr 9, 3:40 pm, "Sven " <sven.holco...@gmail.deleteme.com> wrote:
> akane <androalpha...@yahoo.com> wrote in message
>
> <563ff25e-11bf-4619-b869-7f01c290d...@v26g2000prm.googlegroups.com>...
>
> > Since this a usenet group so it's impossible to post any
> image or file
> > If anyone interested with my project, please do tell me
> your e-mel
> > So that i can send u the files@image
>
> > Please do help me
> > akane
>
> May I suggest that you instead use a free image hosting
> service (such ashttp://imageshack.us/), rather than asking
> for individual peoples' email. After you upload your
> image(s), post a *detailed* description of what you are
> trying to achieve, what you have succeeded with, and the
> specific problems you now have.
>
> I think people will be willing (and able) to help you if you
> do this.
>
> Thanks,
> Sven.
How does the question of translation and rotation comes in template matching? How more comparisions are required other than checking whether a given image is equal to a template image or not? The question of how many template are used in your database is different issue. Let's learn how to simplyfy the things rather thank making things complex and making unnecessarily difficult.
Hi everyone
i want to find out the translation(shift) between the two
images(ref and test) using matlab,in order to registered
them.For that i am using phase correlation method
but i am not getting proper result.So i have refered the
code mentioned in this mail.
but i am not understanding
[y x] = ind2sub(siz,index);
Here what is the value of variable "siz"
pls reply me
"Peter Bone" <peterbone@hotmail.com> wrote in message
<ft4uti$a7o$1@fred.mathworks.com>...
> "akane ajibana" <androalpha_v7@yahoo.com> wrote in message
> <fsnera$t69$1@fred.mathworks.com>...
> > hi everyone..
> > i have need help on template matching. i have an image
that
> > need to be match with 3 subimage(template images).can
anyone
> > teach me on the coding in Matlab
>
> The images cannot be different sizes so you will have to
pad
> out the smaller image with zeros to make it the same size.
> The images must also be square.
>
> % fourier transform both images
> fi = fft2(i);
> fr = fft2(ref);
>
> % perform phase correlation (amplitude is normalized)
> fc = fi .* conj(fr);
> fcn = fc ./ abs(fc);
> c = real(ifft2(fcn));
>
> % find the peak in the correlation plane
> [v index] = max(c(:));
> [y x] = ind2sub(siz,index);
> % invert quadrants due to fft shift
> mid = siz(1) / 2;
> y = y - sign(y-mid-0.5) * mid;
> x = x - sign(x-mid-0.5) * mid;
>
Hi,
i want to find out shift between two images using phase
correlation.
i have referred the following code ,but i am not getting the
plot of ifft ,so pls help me for plotting it
"Peter Bone" <peterbone@hotmail.com> wrote in message
<ft4uti$a7o$1@fred.mathworks.com>...
> "akane ajibana" <androalpha_v7@yahoo.com> wrote in message
> <fsnera$t69$1@fred.mathworks.com>...
> > hi everyone..
> > i have need help on template matching. i have an image that
> > need to be match with 3 subimage(template images).can anyone
> > teach me on the coding in Matlab
>
> The images cannot be different sizes so you will have to pad
> out the smaller image with zeros to make it the same size.
> The images must also be square.
>
> % fourier transform both images
> fi = fft2(i);
> fr = fft2(ref);
>
> % perform phase correlation (amplitude is normalized)
> fc = fi .* conj(fr);
> fcn = fc ./ abs(fc);
> c = real(ifft2(fcn));
>
> % find the peak in the correlation plane
> [v index] = max(c(:));
> [y x] = ind2sub(siz,index);
> % invert quadrants due to fft shift
> mid = siz(1) / 2;
> y = y - sign(y-mid-0.5) * mid;
> x = x - sign(x-mid-0.5) * mid;
>
Hi,
i want to find out shift between two images using phase
correlation.
i have referred the following code ,but i am not getting the
plot of ifft ,so pls help me for plotting it
"Peter Bone" <peterbone@hotmail.com> wrote in message
<ft4uti$a7o$1@fred.mathworks.com>...
> "akane ajibana" <androalpha_v7@yahoo.com> wrote in message
> <fsnera$t69$1@fred.mathworks.com>...
> > hi everyone..
> > i have need help on template matching. i have an image that
> > need to be match with 3 subimage(template images).can anyone
> > teach me on the coding in Matlab
>
> The images cannot be different sizes so you will have to pad
> out the smaller image with zeros to make it the same size.
> The images must also be square.
>
> % fourier transform both images
> fi = fft2(i);
> fr = fft2(ref);
>
> % perform phase correlation (amplitude is normalized)
> fc = fi .* conj(fr);
> fcn = fc ./ abs(fc);
> c = real(ifft2(fcn));
>
> % find the peak in the correlation plane
> [v index] = max(c(:));
> [y x] = ind2sub(siz,index);
> % invert quadrants due to fft shift
> mid = siz(1) / 2;
> y = y - sign(y-mid-0.5) * mid;
> x = x - sign(x-mid-0.5) * mid;
>
Hi,
i want to find out shift between two images using phase
correlation.
i have referred the following code ,but i am not getting the
plot of ifft ,so pls help me for plotting it
"Peter Bone" <peterbone@hotmail.com> wrote in message
<ft4uti$a7o$1@fred.mathworks.com>...
> "akane ajibana" <androalpha_v7@yahoo.com> wrote in message
> <fsnera$t69$1@fred.mathworks.com>...
> > hi everyone..
> > i have need help on template matching. i have an image that
> > need to be match with 3 subimage(template images).can anyone
> > teach me on the coding in Matlab
>
> The images cannot be different sizes so you will have to pad
> out the smaller image with zeros to make it the same size.
> The images must also be square.
>
> % fourier transform both images
> fi = fft2(i);
> fr = fft2(ref);
>
> % perform phase correlation (amplitude is normalized)
> fc = fi .* conj(fr);
> fcn = fc ./ abs(fc);
> c = real(ifft2(fcn));
>
> % find the peak in the correlation plane
> [v index] = max(c(:));
> [y x] = ind2sub(siz,index);
> % invert quadrants due to fft shift
> mid = siz(1) / 2;
> y = y - sign(y-mid-0.5) * mid;
> x = x - sign(x-mid-0.5) * mid;
>
Hi,
i want to find out shift between two images using phase
correlation.
i have referred the following code ,but i am not getting the
plot of ifft ,so pls help me for plotting it
"Peter Bone" <peterbone@hotmail.com> wrote in message
<ft4uti$a7o$1@fred.mathworks.com>...
> "akane ajibana" <androalpha_v7@yahoo.com> wrote in message
> <fsnera$t69$1@fred.mathworks.com>...
> > hi everyone..
> > i have need help on template matching. i have an image that
> > need to be match with 3 subimage(template images).can anyone
> > teach me on the coding in Matlab
>
> The images cannot be different sizes so you will have to pad
> out the smaller image with zeros to make it the same size.
> The images must also be square.
>
> % fourier transform both images
> fi = fft2(i);
> fr = fft2(ref);
>
> % perform phase correlation (amplitude is normalized)
> fc = fi .* conj(fr);
> fcn = fc ./ abs(fc);
> c = real(ifft2(fcn));
>
> % find the peak in the correlation plane
> [v index] = max(c(:));
> [y x] = ind2sub(siz,index);
> % invert quadrants due to fft shift
> mid = siz(1) / 2;
> y = y - sign(y-mid-0.5) * mid;
> x = x - sign(x-mid-0.5) * mid;
>
"poonam jadhav" <poonamsonar@gmail.com> wrote in message
<ftnbsp$gmp$1@fred.mathworks.com>...
> Hi,
> i want to find out shift between two images using phase
> correlation.
> i have referred the following code ,but i am not getting the
> plot of ifft ,so pls help me for plotting it
"poonam jadhav" <poonamsonar@gmail.com> wrote in message
<ftnbsp$gmp$1@fred.mathworks.com>...
> Hi,
> i want to find out shift between two images using phase
> correlation.
> i have referred the following code ,but i am not getting the
> plot of ifft ,so pls help me for plotting it
"poonam jadhav" <poonamsonar@gmail.com> wrote in message
<ftnbsp$gmp$1@fred.mathworks.com>...
> Hi,
> i want to find out shift between two images using phase
> correlation.
> i have referred the following code ,but i am not getting the
> plot of ifft ,so pls help me for plotting it
"poonam jadhav" <poonamsonar@gmail.com> wrote in message
<ftnbsp$gmp$1@fred.mathworks.com>...
> Hi,
> i want to find out shift between two images using phase
> correlation.
> i have referred the following code ,but i am not getting the
> plot of ifft ,so pls help me for plotting it
"Peter Bone" <peterbone@hotmail.com> wrote in message
hi
i want to find out shift in 2 images (image registration).
for that i am using correlation technique.In oreder to
find the shift ,i have to find location of peak in
iif.plot ifft ,but i am not getting it.My code is as
follows
x=imread('mvr1.jpg')
y=imread('mvr2.jpg')
X=fft2(double(x))
Y=fft2(double(y))
CY=conj(Y)
Z=X.*CY
NR=(Z./(abs(X.*CY)))
R=real(ifft(NR))
so here i have to plot R
i have tried meshgrid function,but not getting proper
result.so anybody help me regarding it
<ft4uti$a7o$1@fred.mathworks.com>...
> "akane ajibana" <androalpha_v7@yahoo.com> wrote in
message
> <fsnera$t69$1@fred.mathworks.com>...
> > hi everyone..
> > i have need help on template matching. i have an image
that
> > need to be match with 3 subimage(template images).can
anyone
> > teach me on the coding in Matlab
>
> The images cannot be different sizes so you will have to
pad
> out the smaller image with zeros to make it the same
size.
> The images must also be square.
>
> % fourier transform both images
> fi = fft2(i);
> fr = fft2(ref);
>
> % perform phase correlation (amplitude is normalized)
> fc = fi .* conj(fr);
> fcn = fc ./ abs(fc);
> c = real(ifft2(fcn));
>
> % find the peak in the correlation plane
> [v index] = max(c(:));
> [y x] = ind2sub(siz,index);
> % invert quadrants due to fft shift
> mid = siz(1) / 2;
> y = y - sign(y-mid-0.5) * mid;
> x = x - sign(x-mid-0.5) * mid;
>
Public Submission Policy
NOTICE: Any content you submit to MATLAB Central, including personal information, is not subject to the protections which may be afforded information collected under other sections of The MathWorks, Inc. Web site. You are entirely responsible for
all content that you upload, post, e-mail, transmit or otherwise make available via MATLAB Central. The MathWorks does not control the content posted by visitors to MATLAB Central and, does not guarantee the accuracy, integrity, or quality of such content.
Under no circumstances will The MathWorks be liable in any way for any content not authored by The MathWorks, or any loss or damage of any kind incurred as a result of the use of any content posted, e-mailed, transmitted or otherwise made available
via MATLAB Central. Read the complete Disclaimer prior to use.