From 2bd4f1ec896fa80b264c1241543b8b9103032d99 Mon Sep 17 00:00:00 2001 From: raiots Date: Fri, 2 Jun 2023 22:43:20 +0800 Subject: [PATCH] fix: bug --- utils/ocr.py | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/utils/ocr.py b/utils/ocr.py index 1742bca..91649a9 100644 --- a/utils/ocr.py +++ b/utils/ocr.py @@ -6,7 +6,6 @@ from pytesseract import Output # img_source = cv2.VideoCapture(0) - def get_grayscale(image): return cv2.cvtColor(image, cv2.COLOR_BGR2GRAY) @@ -63,7 +62,7 @@ def identy_char(img_path=None, img_source=None): ''' ident_char = None - if img_path != None and img_source.any() == None: + if img_path != None and img_source == None: source_img = cv2.imread(img_path) elif img_path == None and img_source.any() != None: @@ -86,6 +85,6 @@ def identy_char(img_path=None, img_source=None): if __name__ == "__main__": # identy_char('./img.png') - source_img = cv2.imread('./img.png') - print(identy_char(img_source=source_img)) - # print(identy_char('./coffee-ocr.jpg')) \ No newline at end of file + # source_img = cv2.imread('./img.png') + # print(identy_char(img_source=source_img)) + print(identy_char('./coffee-ocr.jpg')) \ No newline at end of file