You are actually quite lucky on this one, since your image seems like PURE 
RGB, you can split these 3 channels directly (ignore the 4th alpha channel 
of PNG image) and process them independently as grayscale.
Also, in your specific case, you might not really need tesseract. A simple 
template matching might do a very good job in your specific case. Have a 
look at this: 
https://www.pyimagesearch.com/2017/07/17/credit-card-ocr-with-opencv-and-python/
Finally, you might also want to try the legacy engine on this one since 
LSTMs here wouldn't make much sense... This way you could also use the 
whitelist characters feature that is not supported on LSTM engine.

On Thursday, March 26, 2020 at 6:24:34 AM UTC+1, Bill Upham wrote:
>
> Thank you Aaron for the information, it was an improvement, I'm attaching 
> one of the png files that I read. (I have 200)
> It is interesting how It is still not reading every file 100% correctly. 
> My script counts the digits and sometimes it misses one of them or it calls 
> a 1 a 15.
> Maybe I'm expecting perfection from computer vision and that's just not 
> the case!
> Thanks again 
>
> Bill Upham
>
> On Sat, Mar 14, 2020 at 3:03 PM Aaron Stewart <[email protected] 
> <javascript:>> wrote:
>
>>
>> roi = cv2.resize(roi, None, fx=2, fy=2)
>> _, roi = cv2.threshold(roi, 128+64, 255, cv2.THRESH_BINARY)
>> roi = cv2.GaussianBlur(roi, (3,3), 0)
>> text_detected = image_to_string(roi, config="--psm 10 --oem 3  
>> tessedit_char_whitelist=0123456789", )
>>
>> -- 
>> You received this message because you are subscribed to the Google Groups 
>> "tesseract-ocr" group.
>> To unsubscribe from this group and stop receiving emails from it, send an 
>> email to [email protected] <javascript:>.
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/tesseract-ocr/2ca084e4-aae6-423e-b359-a472e00579e6%40googlegroups.com
>>  
>> <https://groups.google.com/d/msgid/tesseract-ocr/2ca084e4-aae6-423e-b359-a472e00579e6%40googlegroups.com?utm_medium=email&utm_source=footer>
>> .
>>
>

-- 
You received this message because you are subscribed to the Google Groups 
"tesseract-ocr" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/tesseract-ocr/fffb348c-43a2-4f46-a30e-4c4fc80b2bbf%40googlegroups.com.

Reply via email to