How to Capture objects in big image and divided them to small images?

Hi,
I stuck at my study now.
I have one example image. ( http://i42.tinypic.com/b653er.jpg) From this image, I would like to separate these five small objects in the picture to be five small images.
How can I do this. I need your help please.
I am looking forward to hear from you. Thank you very much.
Wipapan

 採用された回答

Chandra Kurniawan
Chandra Kurniawan 2012 年 2 月 12 日

0 投票

This code works just for this image only
Irgb = imread('b653er.jpg');
Igray = rgb2gray(Irgb);
Ibw = im2bw(Igray,graythresh(Igray));
Ifill = imfill(Ibw,'holes');
%clear the lines
Ihor = imopen(Ifill,strel('line',5,0));
Iver = imopen(Ihor,strel('line',5,90));
Ilabel = bwlabel(Iver);
stat = regionprops(Ilabel,'BoundingBox');
for x = 1 : numel(stat)
bb = stat(x).BoundingBox;
Icrop{x} = imcrop(Irgb,bb);
subplot(numel(stat),1,x); imshow(Icrop{x});
end

4 件のコメント

Yan
Yan 2015 年 1 月 4 日
Hello, I need to separate the roof, smoke bay, windows, wall and door. I tried to applied the same code for this image. But it seems like nothing happen. Here is the image.
Or is there any other way to separate those thing?
Image Analyst
Image Analyst 2015 年 1 月 4 日
Of course not. Did you see the first line of his answer that said "This code works just for this image only" ? And besides, his code does not do texture segmentation which is what you need.
Yan
Yan 2015 年 1 月 4 日
I just realized it. My mistake. Sorry. So, may I know how can solve my problem? What should I do now since I a newbie in image processing.
Image Analyst
Image Analyst 2015 年 1 月 4 日
Look at section 8.8 here. Pick one, code it up, then create a brand new discussion and attach your code, your image, and your question.

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

その他の回答 (1 件)

warinthorn Kiadti
warinthorn Kiadti 2012 年 2 月 12 日

0 投票

Thank you very much. this is great. XX

製品

Community Treasure Hunt

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

Start Hunting!

Translated by