如何从图像中提取数据[关闭]

问题描述 投票:0回答:1

预期输入: enter image description here

预期输出:

Powder 250gms 10 
Masala 100gms 5 
chicken 500gms 6 
Coco nuts 5 ltrs 
Bananas 12 
Carrot 10kgs 
Rice 20 kgs 5 
Apples 5 kg 
Millet 10 kg 
Dal 20kgs 
Shampoo 3
python ocr
1个回答
0
投票

您想要进行 OCR(光学字符识别)

设置

安装这些依赖项

pip install pillow
pip install numpy 
pip install pytesseract

使用方法

# Import Libraries
from PIL import Image
import pytesseract
import numpy as np

# Define Filename/Path
filename = 'image_01.png'

# Open Said Image into an numpy data array
img1 = np.array(Image.open(filename))

# Process image and get text from it
text = pytesseract.image_to_string(img1)

# Do something with the output text
print(text)

更多

您可以找到更多资源这里

© www.soinside.com 2019 - 2024. All rights reserved.