Untitled

 avatar
unknown
plain_text
a year ago
583 B
5
Indexable
import pytesseract
import matplotlib.pyplot as plt
import cv2
import time
import os.path

HERE = os.path.dirname(os.path.abspath(__file__))


class OGE_blank:
    def __init__(self, filename=os.path.join(HERE, "OGE_blank.jpg")):
        self.image = cv2.imread(filename)

    def get_class(self, x=1253, y=402, w=190, h=88):
        new_img = self.image[y:y + h, x:x + w]

        text = pytesseract.image_to_string(new_img)

        return text


# obj = OGE_blank()
#
# print(obj.get_class())
image = cv2.imread(os.path.join(HERE, "OGE_blank.jpg"))
plt.imshow(image)
time.sleep(10)
Editor is loading...
Leave a Comment