Example of numbers
I am using the standard pytesseract img to text. I have tried with digits only option 90% of the time it is perfect but above is a example where it goes horribly wrong! This example produced no characters at all
As you can see there are now letters so language option is of no use, I did try adding some text in the grabbed image but it still goes wrong.
I increased the contrast using CV2 the text has been blurred upstream of my capture
Any ideas on increasing accuracy?
After many tests using the suggestions below. I found the sharpness filter gave unreliable results. another tool you can use is contrast=cv2.convertScaleAbs(img2,alpha=2.5,beta=-200) I used this as my text in black and white ended up light gray text on a gray background with convertScaleAbs I was able to increase the contrast to get almost a black and white image
Basic steps for OCR
- Convert to monochrome
- Crop image to your target text
- Filter image to get black and white
- perform OCR