mirror of
https://github.com/HIllya51/LunaTranslator.git
synced 2024-12-29 00:24:13 +08:00
nores
This commit is contained in:
parent
b1cce57c3f
commit
c3949794ba
@ -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"]:
|
||||
|
@ -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:
|
||||
|
@ -36,4 +36,6 @@ class OCR(baseocr):
|
||||
|
||||
res = ""
|
||||
text = lens_object["data"][3][4][0]
|
||||
if len(text) == 0:
|
||||
return
|
||||
return text[0]
|
||||
|
Loading…
x
Reference in New Issue
Block a user