coordinates of the farthest point from centroid
조회 수: 1 (최근 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!