Finding matching points between two 2d point sets, but different sizes

8 ビュー (過去 30 日間)
photoon
photoon 2021 年 2 月 25 日
コメント済み: photoon 2021 年 2 月 26 日
I am trying to find the way of identifying matching points between two sets (they are xy coordinates from two shifted images). Their sizes are different. Both sets have many points that are not shared. In other words, I look for algoriths to find same points between two shifted 2D point sets, which are not identical.
  6 件のコメント
photoon
photoon 2021 年 2 月 25 日
I am sorry. Let me attach them again.
There are no logic. I just chose them visually. If you scatter plot them, you will be able to tell easily.
photoon
photoon 2021 年 2 月 25 日
If we just use closest distance criteria, that wouldn't work because images from which points are collected are drifted from each other.

サインインしてコメントする。

回答 (3 件)

weikang zhao
weikang zhao 2021 年 2 月 25 日
if you dont need a very precise result,
clear
load('xy1.mat');
load('xy2.mat');
fixdistance=[-0.27,2.3];
newxy1=xy1+fixdistance;
dis=@(x,y) sum((x-y).^2);
result=struct([]);
structcount=1;
for i=1:size(newxy1,1)
for j=1:size(xy2,1)
if dis(xy2(j,:),newxy1(i,:))<0.1
result(structcount).xy1num=i;
result(structcount).xy2num=j;
result(structcount).xy1=xy1(i,:);
result(structcount).xy2=xy2(j,:);
structcount=structcount+1;
end
end
end
the struct result contains the results you need. If you need a more general and more accurate method to deal with a large number of similar problems, you need to design an algorithm to estimate fixdistance.
have fun!
  2 件のコメント
weikang zhao
weikang zhao 2021 年 2 月 25 日
by the way, optical flow may be help to estimate fixdistance
photoon
photoon 2021 年 2 月 25 日
How to estimate fixdistance was my question. Thank you for your nice rephasement

サインインしてコメントする。


weikang zhao
weikang zhao 2021 年 2 月 26 日
I provide a feasible solution. Assuming that the length of xy1&`xy2` are m and n, first generate a set of size m*n, including the distance between any pair of points, and then deploy a clustering algorithm or GMM fitting algorithm, the cluster center is the fixdistance.
  2 件のコメント
photoon
photoon 2021 年 2 月 26 日
Sorry, what is xy1&`xy2`?
weikang zhao
weikang zhao 2021 年 2 月 26 日
The two sets you provided

サインインしてコメントする。


KSSV
KSSV 2021 年 2 月 26 日
Read about knnsearch.
  1 件のコメント
photoon
photoon 2021 年 2 月 26 日
I read knnsearch. Simply running knnsearch(xy1, xy2) gives a result. However, I don't thinkt this is what I want. Do I have a misunderstanding? Or could we apply this idea for measuring similiarity between two point sets?

サインインしてコメントする。

カテゴリ

Help Center および File ExchangeGeometric Transformation and Image Registration についてさらに検索

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by