Skip to content

Commit e3d4214

Browse files
committed
image recognition
1 parent ad48bcd commit e3d4214

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

ocr/image_recognition.py

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
# tesseract ocr image recognition
2+
3+
import cv2
4+
import numpy as np
5+
import pytesseract
6+
from PIL import Image
7+
8+
image_path=~/Screenshot.png
9+
im= cv2.imread(image_path,cv2.IMREAD_GRAYSCALE)
10+
cv2.imshow('Gray', im)
11+
cv2.imwrite(image_path, im)
12+
print(pytesseract.image_to_string(Image.open(image_path)))
13+

0 commit comments

Comments
 (0)