trying to find 2D similarity patterns by xcorr2
From: lucy (losemind_at_yahoo.com)
Date: 12/21/04
- Next message: glen herrmannsfeldt: "Re: trying to find 2D similarity patterns by xcorr2"
- Previous message: lucy: "how to compare the two image objects with different size?"
- Next in thread: glen herrmannsfeldt: "Re: trying to find 2D similarity patterns by xcorr2"
- Reply: glen herrmannsfeldt: "Re: trying to find 2D similarity patterns by xcorr2"
- Reply: lucy: "Re: trying to find 2D similarity patterns by xcorr2"
- Reply: glen herrmannsfeldt: "Re: trying to find 2D similarity patterns by xcorr2"
- Messages sorted by: [ date ] [ thread ]
Date: Tue, 21 Dec 2004 12:15:20 -0800
Hi all,
I am trying to find 2D similarity patterns in order to match two image
objects...
For simplicity, I want to ask this question in terms of 1D case:
Easy cases are zeros and non-zeros:
But I still don't know the relationship between the position of the peak of
XCORR result and the relative shifting of y that I should do in order to do
a matching...
I mean, I know I should shift "y" a little bit in order for the best
matching... but how much?
>> x=[0 0 0 1 1 1 0 0 0 0];
>> y=[0 0 0 0 0 0 1 1 1 1 0 0 0];
>> xcorr(x, y)
ans =
Columns 1 through 7
0.0000 0 -0.0000 -0.0000 0.0000 -0.0000 1.0000
Columns 8 through 14
2.0000 3.0000 3.0000 2.0000 1.0000 0.0000 -0.0000
Columns 15 through 21
0 -0.0000 0.0000 0 0.0000 0.0000 -0.0000
Columns 22 through 25
0.0000 -0.0000 0 -0.0000
>> x1=[1 1 1 0 0 0 0];
>> y
y =
Columns 1 through 12
0 0 0 0 0 0 1 1 1 1 0 0
Column 13
0
>> xcorr(x1, y)
ans =
Columns 1 through 7
0.0000 0.0000 0.0000 1.0000 2.0000 3.0000 3.0000
Columns 8 through 14
2.0000 1.0000 -0.0000 0.0000 0.0000 0.0000 0.0000
Columns 15 through 21
-0.0000 -0.0000 0.0000 -0.0000 -0.0000 -0.0000 -0.0000
Columns 22 through 25
-0.0000 0 0 -0.0000
>>
Now suppose the similar patterns are embedded in a noisy setting... the
following two vectors have similar patterns of 1 2 3 4 4 ...
How do I detect such a similar pattern? How to decide how many shifts should
my y2 have?
>> x=[1 0 1 1 2 3 4 4 1 0 1 0 1];
>> y2=[1 1 1 1 1 1 2 3 4 4 1 0 1 0 1];
>> xcorr(x, y2)
ans =
Columns 1 through 7
1.0000 0.0000 2.0000 1.0000 4.0000 8.0000 11.0000
Columns 8 through 14
15.0000 17.0000 23.0000 32.0000 42.0000 51.0000 43.0000
Columns 15 through 21
34.0000 26.0000 22.0000 22.0000 20.0000 16.0000 12.0000
Columns 22 through 28
7.0000 3.0000 2.0000 2.0000 1.0000 1.0000 0
Column 29
0.0000
- Next message: glen herrmannsfeldt: "Re: trying to find 2D similarity patterns by xcorr2"
- Previous message: lucy: "how to compare the two image objects with different size?"
- Next in thread: glen herrmannsfeldt: "Re: trying to find 2D similarity patterns by xcorr2"
- Reply: glen herrmannsfeldt: "Re: trying to find 2D similarity patterns by xcorr2"
- Reply: lucy: "Re: trying to find 2D similarity patterns by xcorr2"
- Reply: glen herrmannsfeldt: "Re: trying to find 2D similarity patterns by xcorr2"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|
|