Auto-weight-logger3 / ocr_engine.py
Sanjayraju30's picture
Rename src/ocr_engine.py to ocr_engine.py
de0beca verified
raw
history blame
203 Bytes
import pytesseract
import re
def extract_weight_from_image(image):
text = pytesseract.image_to_string(image)
match = re.search(r"\d+.\d{2}", text)
if match:
return match.group()
return "No weight found"