i try  extract number from screenshot but i cannt. someone help me why.
my code ```
img_data = base64.b64decode(screenshot)
image_pil = Image.open(BytesIO(img_data))
box = (0, 222, 80, 240)
cropped_img = image_pil.crop(box)
image_cv2 = np.array(cropped_img)
image_cv2 = cv2.cvtColor(image_cv2, cv2.COLOR_RGB2BGR)
gray_image = cv2.cvtColor(image_cv2, cv2.COLOR_BGR2GRAY)
resized_image = cv2.resize(gray_image, None, fx=3, fy=3, interpolation
=cv2.INTER_CUBIC)
cv2.imshow('__', resized_image)
cv2.waitKey(0)
pytesseract.pytesseract.tesseract_cmd = r'C:\Program 
Files\Tesseract-OCR\tesseract.exe'
extracted_text = pytesseract.image_to_string(resized_image, config="-c 
tessedit_char_whitelist=0123456789,./")
```
[image: Screenshot 2024-04-29 202702.png]

-- 
You received this message because you are subscribed to the Google Groups 
"tesseract-ocr" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to tesseract-ocr+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/tesseract-ocr/88882fdb-4bd8-47de-b905-467a863f53adn%40googlegroups.com.

Reply via email to