coordinates of the farthest point from centroid
2 次查看(过去 30 天)
显示 更早的评论
boundaries = bwboundaries(pad);
thisBoundary = boundaries{1};
% Get the distances of the boundary pixels from the centroid.
distances = sqrt((thisBoundary(:,1) - a2).^2 + (thisBoundary(:,2) - b2).^2);
% Scan the boundary to find the pixel on it that is
% farthest from the centroid.
maxRadius = max(distances);
a2,b2 are centroid coordinates of the object named 'pad'
above code calculate the farthest distance. could anyone please tell what will be the coordinates of that point on the object boundary.
0 个评论
采纳的回答
Ashish Uthama
2013-4-17
Air code:
[maxRadius, maxRadiusIndex] = max(distances)
maxPointCoord = thisBoundary(maxRadiusIndex,:)
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Image Processing and Computer Vision 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!