How to crop the gray scale image automatically???
1 visualización (últimos 30 días)
Mostrar comentarios más antiguos
Hi, I have a gray scale image of Handwritten word, I want to crop only portion of that image which exactly carries that word or information , overthrow another region , how can I do that, figures are attached...
0 comentarios
Respuestas (1)
Akira Agata
el 12 de Mzo. de 2018
How about the following script?
I = imread('1.jpg');
BW = imbinarize(I);
BW1 = bwconvhull(~BW);
s = regionprops(BW1,'BoundingBox');
I2 = imcrop(I,s.BoundingBox);
2 comentarios
Akira Agata
el 12 de Mzo. de 2018
During your copy&paste, a space seems to be mistakenly inserted.
Correct input:
s = regionprops(BW1,'BoundingBox');
Wrong input:
s = regionprops(BW1,'BoundingBox ');
Ver también
Categorías
Más información sobre Image Segmentation and Analysis 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!