Image cropping help (Crop image at boundary)
1 Ansicht (letzte 30 Tage)
Ältere Kommentare anzeigen
Shawn Castelino
am 26 Mai 2016
Beantwortet: John BG
am 26 Mai 2016
Hello!
I need some help cropping certain shapes individually out of a binary image. Below is an example image.
.
I know an easy way of cropping automatically would be using using regionprops() ('BoundingBox') and using those coordinates and lengths with imcrop(). But that gives me the white part inside a bounding box still surrounded by black.
Is there a way of cropping only the white out, say, using the boundary coordinates found with bwboundaries, or conncomps? Is it possible to crop out the object at the boundary coordinates?
Any help is greatly appreciated, thank you!
0 Kommentare
Akzeptierte Antwort
John BG
am 26 Mai 2016
In the file exchange there are these 2 solutions: 1.- http://uk.mathworks.com/matlabcentral/fileexchange/17460-cropping-an-image-with-draggable-rectangle?s_tid=srchtitle
3.- and from Image Analyst, an accepted answer:
croppedImage = imcrop(yourImage, [1 1 200 300]);
where [xmin ymin width height] is [xmin ymin width height]
If you find this answer of any help solving your question,
please click on the thumbs-up vote link, or mark is accepted answer
thanks in advance
John
0 Kommentare
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu Geometric Transformation and Image Registration finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!