Borrar filtros
Borrar filtros

how to save many sub-images?

3 visualizaciones (últimos 30 días)
kiran
kiran el 1 de Abr. de 2014
Respondida: Image Analyst el 1 de Abr. de 2014
Hi i am creating a OCR.for that i have identified positio)n of each character using bounding boxes. now i have to crop each of these sub images(each of these boxes shown in image) and save them. How can i do this?

Respuestas (2)

Dishant Arora
Dishant Arora el 1 de Abr. de 2014
Editada: Dishant Arora el 1 de Abr. de 2014
Stats = regionprops(BW , 'BoundingBox'); % BW is your preprocessed binary image.
for ii = 1:length(Stats)
croppedImage = imcrop(origionalImage , Stats(ii).BoundingBox);
imageName = strcat('croppedCharactor' , num2str(ii));
imwrite(croppedImage , imageName , format) % see docmentation for allowed formats.
end

Image Analyst
Image Analyst el 1 de Abr. de 2014
You can see that in a larger context of an Image Segmentation Tutorial in my File Exchange http://www.mathworks.com/matlabcentral/fileexchange/25157-image-segmentation-tutorial-blobsdemo. It crops out the sub images it found.

Categorías

Más información sobre Convert Image Type en Help Center y File Exchange.

Community Treasure Hunt

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

Start Hunting!

Translated by