How to find the minimum area bounding box of a region returned from regionprops

For an image containing rectangles that are rotated with respect to the image axes, regionprops will return the bounding box coordinates of an ROI containg a rectangle, but with the ROI edges parallel with the image edges. The minimum area bounding box would be an ROI having verticies congruent with the rectangles corners; a bounding box with edges not parallel to the image axes.
Is there a function that utilizes the output of regionprops for a given region in an image and produces the minimum area bounding box? It seems this should be possible using the Feret dimensions.

回答 (1 件)

Image Analyst
Image Analyst 2024 年 1 月 4 日

0 投票

Yes it is. Did you actually try to use the bwferet function? If not, you should.

2 件のコメント

Jeremy
Jeremy 2024 年 1 月 9 日
移動済み: Image Analyst 2024 年 1 月 9 日
Yes. However, the "A suite of minimal bounding objects" at https://www.mathworks.com/matlabcentral/fileexchange/34767-a-suite-of-minimal-bounding-objects?s_tid=srchtitle was necessary to provide a "tilted rectangle" bounding box.
Even so, it seems that without the MSER "minimum diversity" parameter not being accessible in the detectMSERFeatures causes minor noise on the edges of a real rectangle (similar to a "hanging chad") in an image to be fit within the corners identified for the tilted rectangle bounding box. This could probably be mitigated for "known tilted rectangles" by performing a least squares fit on each edge of the pixel region, but the minimum diversity should allow for minor noises to be droped from the pixel list for a MSER feature.
Is the minimum diversity able to be set is some other fashion?
Image Analyst
Image Analyst 2024 年 1 月 9 日
移動済み: Image Analyst 2024 年 1 月 9 日
I don't know. You can try editing the function - sometimes the source code is available. Then you could make a copy and code in your custom modifications.

サインインしてコメントする。

製品

リリース

R2023b

質問済み:

2024 年 1 月 4 日

移動済み:

2024 年 1 月 9 日

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by