edit-rectangle box for each word

I have an image
in that i want to draw rectangle box for each word ,please help

4 件のコメント

Jan
Jan 2012 年 5 月 7 日
What is the difference to your former question http://www.mathworks.com/matlabcentral/answers/37390-rectangle-box-for-each-word ?
kash
kash 2012 年 5 月 7 日
JAn both are same you said that that image is not clear ,that why posted anoter image,please provide assistance
Jan
Jan 2012 年 5 月 7 日
Please do not post multiple question for one problem. Imagine what happens, if somebody, who wants to help, read your former message. Creating a new question and leaving the old one without explanations or clarifications wastes her or his time, and this reduces the efficiency of this forum. It is much better to edit the original question to add new details.
kash
kash 2012 年 5 月 7 日
Ok Jan

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

 採用された回答

Andrei Bobrov
Andrei Bobrov 2012 年 5 月 7 日

0 投票

i0 = imread('image1.bmp');
i1 = im2bw(i0,graythresh(i0));
i2 = imfill(i1,'holes');
s = regionprops(i2,'Area','BoundingBox' );
[~,idx] = max([s.Area]);
i3 = imcrop(i1,s(idx).BoundingBox);
i4 = imcrop(i2,s(idx).BoundingBox);
i3(~i4) = true;
i4 = ~i3;
s1 = regionprops(i4,'BoundingBox');
c = cat(1,s1.BoundingBox);
imshow(i3);
hold on
for jj = 1:size(c,1)
x = [1;1]*(c(jj,1:2:end)+ [0 c(jj,1)]);
y = (c(jj,2:2:end)+ [0 c(jj,2)]).'*[1 1];
plot([x(:);x(1)],y([1,2,4,3,1]),'r-');
end

1 件のコメント

kash
kash 2012 年 5 月 7 日
THANKS A LOT ANDREI AM VERY GREATFUL TO YOU

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

その他の回答 (0 件)

カテゴリ

ヘルプ センター および File ExchangeStartup and Shutdown についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by