how to find mid point between two centroids of objects?

조회 수: 4 (최근 30일)
Rujal
Rujal 2016년 2월 7일
댓글: Image Analyst 2016년 2월 7일
hello friends,
I want to find mid points between two centroids of objects.
I have used this code :
for n=1:Ne
[r,c] = find(L==n);
s = regionprops(L, 'centroid');
centroids = cat(1, s.Centroid);
imshow(image);
hold on
plot(centroids(:,1), centroids(:,2), 'b*');
I found the result as
This code gives the centroids from the corner points too. which are unnecessary. how to remove them?
I would be thankful if someone helps me to find mid point between two two centroids of objects by finding the distance between them or else.
thanks in advance.

채택된 답변

Walter Roberson
Walter Roberson 2016년 2월 7일
mean(centroids)
  댓글 수: 6
Rujal
Rujal 2016년 2월 7일
its working...thank you so much...

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

추가 답변 (0개)

Community Treasure Hunt

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

Start Hunting!

Translated by