First commit OCR_earsing and Synthetics Handwritten Recognition awesome repo

This commit is contained in:
2024-09-16 19:11:05 +07:00
parent d27ba1890b
commit 17aa33a17a
72 changed files with 12419 additions and 1 deletions

View File

@@ -0,0 +1,17 @@
import cv2
import easyocr
def easy_ocr_extraction(
img_path: str
) -> dict:
org_img_bgr = cv2.imread(img_path)
reader = easyocr.Reader(['fr', 'en'])
result = reader.readtext(org_img_bgr)
word_info = []
for (bbox, text, _) in result:
word_info.append(
[bbox[0][0], bbox[0][1], bbox[2][0], bbox[2][1], text]
)
return word_info