Python Forum
pytesseract - enhance image before OCR
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
pytesseract - enhance image before OCR
#1
Hi,

I'd like to get pytesseract correctly recognise characters from a security camera's OSD.

Here is a sample:
sample OSD image

And here is the code that doesn't recognise that misses the 0 characters:

def getDate(osd):
    img = Image.open(osd)
    text = pytesseract.image_to_string(img, lang='eng', config='--psm 10 --oem 1 -c tessedit_char_whitelist=-:0123456789')
    print(text)
As I run it on this sample picture, it gives me this:
2618-11-69 16:21:57

Do you guys have any idea, how can I get pytessearct do the job?

Thanks,
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Help with CV2 pytesseract detcet numbers korenron 0 1,473 Apr-29-2021, 02:48 PM
Last Post: korenron
  help with pytesseract.image_to_string(savedImage, config='--psm 11')iamge to string korenron 0 2,684 Apr-29-2021, 10:08 AM
Last Post: korenron
  PYTesseract Problem gw1500se 2 3,124 Mar-26-2020, 02:11 PM
Last Post: gw1500se
  Error when executing pytesseract to get the text from image bvdinesh 3 17,878 Oct-19-2019, 05:01 PM
Last Post: cwco00
  Getting Tesseract to work for pytesseract bigmit37 0 7,467 May-03-2017, 05:20 PM
Last Post: bigmit37

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020