I want to extract subimages from an image like below. There are 6 components in the image, I want to crop this image into 6 images in a way each individual image contain only 1 component. Can I automatically do it by Mathematica?
Thanks in advance.
I want to extract subimages from an image like below. There are 6 components in the image, I want to crop this image into 6 images in a way each individual image contain only 1 component. Can I automatically do it by Mathematica?
Thanks in advance.
Thanks martin !!
SplitImage[image_] := Module[
{m, components},
m = MorphologicalComponents[image];
components =
ComponentMeasurements[{m, image}, {"Area", "BoundingBox"},#1>100&];
ImageTrim[image, #] & /@ components[[All, 2, 2]]
]
ImagePartition[ ]orMorphologicalComponents[ ]? – Dr. belisarius Mar 05 '16 at 08:03ComponentMeasurementsandImageTrimin the documentation. – Niki Estner Mar 05 '16 at 08:59