This commit is contained in:
test123456654321 2024-10-26 12:27:19 +08:00
parent b1cce57c3f
commit c3949794ba
3 changed files with 5 additions and 1 deletions

View File

@ -90,6 +90,8 @@ def ocr_run(qimage: QImage):
try:
ocr_init()
res = _ocrengine._private_ocr(image)
if not res:
return "", None
gobject.baseobject.maybesetocrresult(res)
text = res["textonly"]
if res["isocrtranslate"]:

View File

@ -129,7 +129,7 @@ class baseocr(commonbase):
elif isinstance(text, (tuple, list)):
text = {"text": text}
elif not text:
text = {}
return
boxs = text.get("box")
texts = text.get("text")
if not boxs:

View File

@ -36,4 +36,6 @@ class OCR(baseocr):
res = ""
text = lens_object["data"][3][4][0]
if len(text) == 0:
return
return text[0]