![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/168689/image.jpeg)
How to Capture objects in big image and divided them to small images?
1 visualizzazione (ultimi 30 giorni)
Mostra commenti meno recenti
warinthorn Kiadti
il 8 Feb 2012
Commentato: Image Analyst
il 4 Gen 2015
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
0 Commenti
Risposta accettata
Chandra Kurniawan
il 12 Feb 2012
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
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/168689/image.jpeg)
4 Commenti
Yan
il 4 Gen 2015
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
il 4 Gen 2015
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.
Più risposte (1)
Vedere anche
Prodotti
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!