How to draw bounding boxes around the ROI obtained by thresholding.
9 views (last 30 days)
Show older comments
I want to highlight the region of interest using rectangular bounding box on the original image.
Can anyone here help me with this?
0 Comments
Answers (1)
Image Analyst
on 4 Apr 2018
props = regionprops(binaryImage, 'BoundingBox');
for k = 1 : length(props)
thisBB = props(k).BoundingBox;
hold on;
rectangle('Position', thisBB);
end
2 Comments
Image Analyst
on 6 Apr 2018
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().
See Also
Categories
Find more on Image Processing Toolbox in Help Center and File Exchange
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!