mirror of
https://github.com/mofeng-git/One-KVM.git
synced 2025-12-15 10:40:28 +08:00
ocr: close old image on resizing
This commit is contained in:
parent
170cee937d
commit
2459e3a259
@ -151,7 +151,10 @@ class TesseractOcr:
|
|||||||
image = image_cropped
|
image = image_cropped
|
||||||
|
|
||||||
ImageOps.grayscale(image)
|
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)
|
_libtess.TessBaseAPISetImage(api, image.tobytes("raw", "RGB"), image.width, image.height, 3, image.width * 3)
|
||||||
text_ptr = None
|
text_ptr = None
|
||||||
try:
|
try:
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user