diff options
-rw-r--r-- | kvmd/apps/kvmd/tesseract.py | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/kvmd/apps/kvmd/tesseract.py b/kvmd/apps/kvmd/tesseract.py index a5292439..58cba9ae 100644 --- a/kvmd/apps/kvmd/tesseract.py +++ b/kvmd/apps/kvmd/tesseract.py @@ -151,7 +151,10 @@ class TesseractOcr: image = image_cropped ImageOps.grayscale(image) - image=image.resize((int(image.size[0]*2),int(image.size[1]*2)), PilImage.BICUBIC) + image_resized = image.resize((int(image.size[0] * 2), int(image.size[1] * 2)), PilImage.BICUBIC) + image.close() + image = image_resized + _libtess.TessBaseAPISetImage(api, image.tobytes("raw", "RGB"), image.width, image.height, 3, image.width * 3) text_ptr = None try: |