Question

My program parses a line of text. In the following picture, I have drawn the bounding boxes around each char as coming from the Tesseract result iterator:

Tesseract bounding boxes

Apparently Tesseract has some problems segmenting the last character ('5') in the line, detecting 3 bounding boxes. The last character is in fact a tad larger than the other characters, but why would Tesseract segment that character so differently when the pixel blob is thresholded so clearly?

I have set these Tesseract variables:

tess.setVariable("save_blob_choices", "1");
tess.setPageSegMode(PageSegMode.PSM_SINGLE_LINE);
tess.setVariable(TessBaseAPI.VAR_CHAR_WHITELIST, "0123456789"
and textord_min_xheight set to the pixel height of the above image

Any suggestions?

Was it helpful?

Solution

I did not find any solution to this problem. Tesseract is so badly documented.

I ended up finding the contour of every character and then passing each sub-image of a character to Tesseract, with the page segmentation mode PSM_SYMBOL. In the end, this was also twice as fast as the previous method!

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top