how to find mid point between two centroids of objects?
1 次查看(过去 30 天)
显示 更早的评论
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
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/154242/image.jpeg)
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.
0 个评论
采纳的回答
Walter Roberson
2016-2-7
mean(centroids)
6 个评论
Image Analyst
2016-2-7
I answered this in your duplicate question: http://www.mathworks.com/matlabcentral/answers/266889-how-to-draw-polar-histogram-of-the-object-of-image#comment_341030
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Feature Detection and Extraction 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!