Error when extracting text from a tesseract image django

0

I have tried different solutions to extract the text of an image, the code I use is the following:

    import pytesseract
    from PIL import Image, ImageEnhance, ImageFilter
    from pytesseract import image_to_string
    #url imagen
    path = 'media/normas/temp.jpg'


    #obteniendo el texto de la imagen
    image = Image.open(path)
    text = pytesseract.image_to_string(image, lang='spa')
    print(text)

the result is the following and it is strange:

,, .…c……
1…¡_»€…m.a…m…1 ¿a¿f¿¿3_…k
k…mmy … y

: … … … o……… …… … … s…… … ………º… … … W……
¿.º…………… n …… ……a.…………… …… …… …… ………… …

EN……—

o.… =¡ …… 13 M … Novrr|!5 & Rewqu c…… c…e……… de P……
me…… ue no…… a… …… dncnnuumz m… m…… 51Ru¡xglm …… Nm
157 de m de …… ¿. zum… mm… w.… eslab1:mmnnms que va…… a s……
p…au……=nn.na……n cnm¿vmmnsln1aime> .q………uyuo…e…m……
… a. … xul7ve …… Pvácncas He Ma…rmwa= pam … men…… de pmducms
!u'mauáuHmscue ¡e =…x…e… … uuurma Dmumlunsl ¡—

mu, e1 …… 55 de! E…… n…… …… Aa……anw …… E…… mms
cs…mees … … aún! s………… que sxp1dan1uxorgannsyummsx wmendnsmzste
cs'9lumw exnnquen … …n… en3i!<1u ………=…v.es …… … peudnrde155vmu1mam

The image I use is the following:

It does not return any error to me, it only brings me that text that has nothing to do with the image, I would appreciate any suggestion or help !!

    
asked by Diego Avila 06.06.2018 в 00:38
source

0 answers