Dear all,
I am processing bounding boxes containing one single letter each one. The bounding box is found with other techniques, and a pre-processing step directly creates a binary mask quite well segmented for the Tesseract-OCR. The method works, but sometimes it happens that the OCR is detecting fake characters due to reflexes or small eroded/dilated region. In particular, in these cases, it happens that Tesseract seems to "revert" background and foreground, since printing the symbol bounding box it is evident that, from the whole region, Tesseract has evaluated a symbol just switching background and foreground. Is there any way by using the API to explicitly specify which color in the binary mask represents the background, and which one the foreground? I deduce that with this artefact I would minimize the error of getting incorrect detection. I can also do it as a post-processing step (like filling the connected region and check the value of the central pixel and so on), but whatever I do would be less efficient then "suggesting" to the OCR background and foreground.
Thank you