Single Characther Cursive Processing

2 次查看(过去 30 天)
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,
into this
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

采纳的回答

Walter Roberson
Walter Roberson 2021-2-7
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 个评论
Walter Roberson
Walter Roberson 2021-2-7
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);
yoel y
yoel y 2021-2-7
Thank you so much for your help. I really appreciate it

请先登录,再进行评论。

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Modify Image Colors 的更多信息

产品


版本

R2017b

Community Treasure Hunt

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

Start Hunting!

Translated by