how to find location on a blob
3 ビュー (過去 30 日間)
古いコメントを表示
Can somebody suggest a way to find the farthest white pixel in a binary image, shown in the picture with red circle. Thanks in advance
3 件のコメント
Image Analyst
2022 年 1 月 6 日
編集済み: Image Analyst
2022 年 1 月 6 日
My Answer below found the point's column value. I think perhaps you overlooked it.
I'll modify it to get the y value from the bottom most pixel.
採用された回答
Image Analyst
2022 年 1 月 5 日
編集済み: Image Analyst
2022 年 1 月 6 日
How about
[rows, columns] = find(binaryImage);
[rightMostColumn, index1] = max(columns)
[bottomMostRow, index2] = max(rows)
deltaY = bottomMostRow - rows(index1); % Add 1 if you want.
Or to get the bounding box(es):
props = regionprops(binaryImage, 'BoundingBox');
Be aware that the bounding box is half a pixel outside the actual white pixels.
0 件のコメント
その他の回答 (0 件)
参考
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!