x = pytesseract.image_to_string(im1, lang='eng', config='--psm 10 --oem 1 -c tessedit_char_whitelist=1234567890JQKA')
print('' + x + '')
output ***9
How do I get rid of line returns and spaces or what am I doing wrong? Just reading one char/number.
x = pytesseract.image_to_string(im1, lang='eng', config='--psm 10 --oem 1 -c tessedit_char_whitelist=1234567890JQKA')
print('' + x + '')
output ***9
How do I get rid of line returns and spaces or what am I doing wrong? Just reading one char/number.
Can you show the image you're processing? The print quotes and the content + x + also look strange to me. These ***9 : are these stars actually printed, because you say to get rid of "spaces and returns"? Or it's an emphasize?
Right, --psm 10 is for recognized single characters.
If the output has spaces and returns only (not ***) you can trim it: How do I trim whitespace?
x = x.strip()
(Possibly the spaces and lines not count as recognized characters).