how to convert a segmented image to a set of bounding boxes?

6 ビュー (過去 30 日間)
samar mahmoud
samar mahmoud 2020 年 3 月 1 日
コメント済み: samar mahmoud 2020 年 3 月 2 日
I have use the function
L = imsegkmeans(I,k)
to segement image into region. Now, How to convert the output L into a set of bounding boxes?
Any idea. Need help.

回答 (1 件)

KALYAN ACHARJYA
KALYAN ACHARJYA 2020 年 3 月 2 日
regionprops(segmmented_image, 'BoundingBox' );
then
rectangle
See the Matlab Documention for details
  1 件のコメント
samar mahmoud
samar mahmoud 2020 年 3 月 2 日
I write the code
measure=regionprops(L,'BoundingBox'); no=size(measure,1);
hold on
for k=1:no
bb=measure(k).BoundingBox;
rectangle('Position',bb,'LineWidth',2)
end
but the output is the same value for all regions
bb=[.5,.5, 219, 265]
what is this meaning

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

Community Treasure Hunt

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

Start Hunting!

Translated by