How to draw bounding boxes around the ROI obtained by thresholding.
8 次查看(过去 30 天)
显示 更早的评论
I want to highlight the region of interest using rectangular bounding box on the original image.
Can anyone here help me with this?
0 个评论
回答(1 个)
Image Analyst
2018-4-4
props = regionprops(binaryImage, 'BoundingBox');
for k = 1 : length(props)
thisBB = props(k).BoundingBox;
hold on;
rectangle('Position', thisBB);
end
2 个评论
Image Analyst
2018-4-6
You have to switch the current axes to the one you want to put the boxes onto. For example call subplot() or axes() before you call rectangle().
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Image Processing Toolbox 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!