-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy patheasyocr_usage.py
More file actions
30 lines (26 loc) · 929 Bytes
/
easyocr_usage.py
File metadata and controls
30 lines (26 loc) · 929 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
# -*- coding: utf-8 -*-
# @Time : 2022/2/22 21:25
# @Author : beyoung
# @Email : linbeyoung@stu.pku.edu.cn
# @File : easyocr_usage.py
import os
import easyocr
import cv2
from matplotlib import pyplot as plt
import numpy as np
import sys
sys.path.append(r"../oracle/utils.py")
# import utils.
# IMAGE_PATH = '../oracle/result/甲骨文字編-李宗焜_cut_cor_1_ot_whole_pic_table_0_5.jpg'
# IMAGE_PATH = '../oracle/result/甲骨文字編-李宗焜_cut_cor_1_ot_whole_pic_table_0_6.jpg'
# IMAGE_PATH = '../oracle/result/甲骨文字編-李宗焜_cut_cor_1_ot_whole_pic_table_0_7.jpg'
IMAGE_PATH = '../oracle/result/甲骨文字編-李宗焜_cut_cor_102_ot_whole_pic_table_0.jpg'
# reader = easyocr.Reader(['ch_tra', 'en'])
reader = easyocr.Reader(['ch_sim', 'en'])
result = reader.readtext(IMAGE_PATH, paragraph="False")
print(result)
boxes = []
for res in result:
boxes.append(res[0])
print(res[0])
print(boxes)