I’m using the Tesseract OCR for an application I’m writing. I just want to recognize the text on some areas from a picture I get from time to time. The Basic calls work at the moment
tesseract::TessBaseAPI api;
api.SetPageSegMode(tesseract::PSM_AUTO); // Segmentation on auto
api.Init("/usr/local/share/","eng"); // path = parent directory of tessdata
pFile = fopen( "home/myname/test.bmp","r" ); // Open picture
PIX* image; // Image format from leptonica
image = pixReadStreamBmp(pFile);
fclose(pFile);
api.SetImage(image); // Run the OCR
char* textOutput = new char[512];
textOutput =api.GetUTF8Text(); // Get the text
So far this code works fine. But at some point the OCR isnt as accurate as I would wish. I actually don’t want to train a new language for my purpose, so I wanted to know if there is any possibility to increase the accuracy over some API calls?
Maybe some suggestions here!
Best Regards
Tobias
May be, you should provide some enhancement for image.
Smoothing the image remove noises inside image and it will decrease false results.
Pixel height of alphabets will be better in the range of 30 or 40.
Although tesseract work on grayscale images, binary images are found to give better results. For thresholding, use method of Adaptive thresholding.
It is also good to have enough space between words.
You can get further tips from tesseract forum.