Detect punctuation marks on ocr

Hi,
I'm trying to do an application regarding ocr.
How can the ocr detect punctuation marks like period?
i trained an image in the "ocr trainer" the ocr trainer detected the numbers and period, but "period" is not recognized when i tried to write the output to .txt file
here is the sample processed image
i already processed the original image using the following code snippet
str = "testimage.jpg";
I = imread('testRawImage.jpg');
I = rgb2gray(I);
Icorrected = imtophat(I,strel('cube',8));
contrastAdjusted = imadjust(Icorrected);
BW1 = imbinarize(contrastAdjusted);
imwrite(BW1,str)
output in txt file is (period is not recognized, but i checked on ocr trainer the period is recognized using the ocr trainer):
1420545
1420575
142024
142031
i used fprintf to write in txt file.
if it helps i used the language i made using the ocr trainer.
this is my ocr snippet
ocrResults = ocr(H, 'Language','test.traineddata');

4 件のコメント

Image Analyst
Image Analyst 2020 年 4 月 26 日
What are H and 'test.traineddata'? Please attach the script so we can try it ourselves. And attach the original image rather than the processed image.
Robert Cadavos
Robert Cadavos 2020 年 4 月 26 日
hi i uploaded the files i used for the application, unfortunately I cannot upload the .txt file and traineddate file because of the file format.
test.traineddata is the output of ocr trainer
Robert Cadavos
Robert Cadavos 2020 年 4 月 26 日
i got it working i just changed the ocr to
ocrResults = ocr(H,'CharacterSet','.0123456789');
Thanks

サインインしてコメントする。

回答 (0 件)

カテゴリ

ヘルプ センター および File ExchangeMATLAB Mobile についてさらに検索

タグ

質問済み:

2020 年 4 月 26 日

コメント済み:

2020 年 4 月 26 日

Community Treasure Hunt

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

Start Hunting!

Translated by