Single Characther Cursive Processing
2 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
yoel y
el 7 de Feb. de 2021
Comentada: yoel y
el 7 de Feb. de 2021
Hello,
I'm researching on handwritten letter recognition using matlab. I have several pre-processed image that i took before, and i want to build a program that can automatically find the area of a character like below
from this,
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/511967/image.png)
into this
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/511972/image.png)
I've been searching for answers, but i only find cursive related question, which disccused how to extreact letters from words in an image. If anyone knows the solution, please let me know, thank you so much.
p.s. : i've attached one preprocessed image
0 comentarios
Respuesta aceptada
Walter Roberson
el 7 de Feb. de 2021
info_struct = regionprops(imbinarize(YourImage), 'Area');
areas = [info_struct.Area];
This would give a separate area for each separate section. Separate sections could be due to having multiple characters in one image, or could be do to (for example) the dot being separate from the main stroke of a character
If you are certain that there is only one character in the image and you want to know the combined areas, then
area = nnz(imbinarize(YourImage))
3 comentarios
Walter Roberson
el 7 de Feb. de 2021
bw = imbinarize(YourImage);
info_struct = regionprops(bw, 'Area', 'Image');
info_struct(K).Area is now the area of the K'th section, and info_struct(K).Image is now a binary image, on for each pixel inside the region.
If you are sure you want to count all the regions together (for example count the dot of an i as part of the same image) then
bw = imbinarize(YourImage);
info_struct = regionprops(double(bw), 'Area', 'Image');
You can also instead
bw = imbinarize(YourImage);
area = nnz(bw);
maskv = any(bw,1);
lb = find(maskv,1,'first');
rb = find(maskv,1,'last');
maskh = any(bw,2);
tb = find(maskh,1,'first');
bb = find(maskh,1,'last');
Image = YourImage(tb:bb, lb:rb);
Más respuestas (0)
Ver también
Categorías
Más información sobre Modify Image Colors 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!