필터 지우기
필터 지우기

finding x-y coordinate of object with specific distance

조회 수: 3 (최근 30일)
Marry M
Marry M 2015년 11월 18일
댓글: Marry M 2015년 11월 21일
hello,
I have a binary image with five objects in it, I've found the distances between each pair, I gonna find the x-y coordinates of the two objects which have the special distances (for example the biggest distances), how can I do that? Thank you for your help in advance.

채택된 답변

Walter Roberson
Walter Roberson 2015년 11월 19일
With PairWiseDistanceArray being your 5 x 5 distance array where the index (I,J) is the distance between object #I and object #J, then:
[maxdistance, maxidx] = max(PairWiseDistanceArray(:));
[object1idx, object2idx] = ind2sub(size(PairWiseDistanceArray),maxidx);
The maximum distance was maxdistance and it was between object #object1idx and object #object2idx
  댓글 수: 11
Walter Roberson
Walter Roberson 2015년 11월 21일
obj1 and obj2 are not the x and y coordinates, they are the object number.
xp1 = centrex(obj1);
xp2 = centrex(obj2);
yp1 = centreY(obj1);
yp2 = centreY(obj2);
Marry M
Marry M 2015년 11월 21일
ok, thank you.

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Geometric 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