Tesseract character recognition and C++

64 views
Skip to first unread message

Fish Money

unread,
Sep 24, 2022, 2:36:07 PM9/24/22
to tesseract-ocr

I read single characters with C++ and tesseract/leptonica. Below is chunk I use.

is it possible to improve accuracy to use some special function, in case if I read only one character. Of course I have openCV mat with cropped image to fit the character size.

char *outText1;

tesseract::TessBaseAPI *api1 = new tesseract::TessBaseAPI(); if (api1->Init(NULL, "eng")) { fprintf(stderr, "Could not initialize tesseract.\n"); exit(1); } api1->SetImage((uchar*)imgWarpCopy1.data, imgWarpCopy1.size().width, imgWarpCopy1.size().height, imgWarpCopy1.channels(), imgWarpCopy1.step1()); outText1 = api1->GetUTF8Text(); int temp1 = strlen(outText1); string_read = outText1[temp1-3]; api1->End(); delete api1; delete [] outText1;

Zdenko Podobny

unread,
Sep 26, 2022, 12:31:16 PM9/26/22
to tesser...@googlegroups.com
If there would be a magic function for improving accuracy that works for any case we would implement it years ago.
Please read relevant documentation where we collected tesseract best experiences.

Image preprocessing depends on the image you did not show (instead of that you posted not formatted code) - please think before sending a post to (any) forum.

Zdenko


so 24. 9. 2022 o 20:36 Fish Money <fishmo...@gmail.com> napísal(a):
--
You received this message because you are subscribed to the Google Groups "tesseract-ocr" group.
To unsubscribe from this group and stop receiving emails from it, send an email to tesseract-oc...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/tesseract-ocr/8086612a-cc2d-4549-ab6b-71235dcb67aen%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages