How to lighten background

We’re trying to read the text in an image, in this case a passport. In the Ok example, everything reads without any problems. In the Ko example, many of the ‘<’ characters are interpreted as ‘C’ or ‘K’. The only difference is that the Ko makes the background a little darker. Any ideas? We’ve tried several filters and also RecognizePassport, without success.

Ko.jpg (25,6 KB)

Ok.png (126,6 KB)

@antfor

Could you please provide more details about the specific methods or filters you have tried to lighten the background in the images?

We’ve tried with skew, contrast correction and grayscale.

Our case is to recognize texts on hotel guest ID cards. We use a photo taken with the guest’s mobile phone or on a website. We haven’t been able to get this tool to work; we don’t know the correct parameters for the recognition to work. Sometimes it works with a low-quality scanned image (which isn’t our case), sometimes with a smartphone photo, sometimes the other way around. It’s crazy. We need to know how to do this reliably and, above all, consistently. Is there an ideal resolution? An ideal image size? Lighting? We don’t know whether to scale up or down, because sometimes one thing is correct and sometimes another.

@antfor

Minimum resolution of the image to be recognized should be 300DPI. However, we need to investigate against your case to provide more details. Can you please share which code snippet are you using to perform OCR operation at your end?