Azzera filtri
Azzera filtri

Single Characther Cursive Processing

2 visualizzazioni (ultimi 30 giorni)
yoel y
yoel y il 7 Feb 2021
Commentato: yoel y il 7 Feb 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,
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

Risposta accettata

Walter Roberson
Walter Roberson il 7 Feb 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 Commenti
Walter Roberson
Walter Roberson il 7 Feb 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);
yoel y
yoel y il 7 Feb 2021
Thank you so much for your help. I really appreciate it

Accedi per commentare.

Più risposte (0)

Categorie

Scopri di più su Modify Image Colors in Help Center e File Exchange

Prodotti


Release

R2017b

Community Treasure Hunt

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

Start Hunting!

Translated by