I need to get the text from image but in my image it only has one number it could be anything between 1-9 i need to get that number. i am using pytesseract to do this but on reading it shows empty text. the below is my image:
below is what i am trying:
from PIL import Image, ImageEnhance, ImageFilter
import pytesseract
def getText(image):
image = Image.open(image)
image.show()
image = image.point(lambda x: 0 if x < 143 else 255) # To clean Image
# text = pytesseract.image_to_string(image).encode('utf-8').strip()
text = pytesseract.image_to_string(image)
return text
image1 = '/home/einfochips/Documents/Kroger_Automation_Framework/src/main/scripts/background.png'
txt1 = getText(image1)
print txt1, '_______________', type(txt1), len(txt1)