I am using pytesseract to extract text from an image.
from PIL import Image
from pytesseract import image_to_string, image_to_boxes, image_to_data
img = Image.open('device.png')
print(image_to_boxes(img))
print(image_to_data(img))
print(image_to_string(img))
This is my image and i want to extract data from the image.
I have started with the above code and output from the first two print statements is:
~ 0 0 0 0 0
level page_num block_num par_num line_num word_num left top width height conf text
1 1 0 0 0 0 0 0 1027 742 -1
2 1 1 0 0 0 0 0 0 742 -1
3 1 1 1 0 0 0 0 0 742 -1
4 1 1 1 1 0 0 0 0 742 -1
5 1 1 1 1 1 0 0 0 742 95
The third print statement doesn't give output or rather a null output. I am confused if I am going wrong somewhere? Is this the correct way to use OCR to extract text from image