mirror of
https://github.com/LmeSzinc/StarRailCopilot.git
synced 2024-11-16 06:25:24 +00:00
Fix: Invert planner page colors to have better ocr results
on black letters and white background
This commit is contained in:
parent
c729421bd2
commit
ed193e0767
@ -1,5 +1,6 @@
|
|||||||
import re
|
import re
|
||||||
|
|
||||||
|
import cv2
|
||||||
from pponnxcr.predict_system import BoxedResult
|
from pponnxcr.predict_system import BoxedResult
|
||||||
|
|
||||||
from module.base.utils import area_center, area_in_area
|
from module.base.utils import area_center, area_in_area
|
||||||
@ -70,10 +71,7 @@ class OcrPlannerResult(OcrWhiteLetterOnComplexBackground, OcrItemName):
|
|||||||
return super().detect_and_ocr(image, *args, **kwargs)
|
return super().detect_and_ocr(image, *args, **kwargs)
|
||||||
|
|
||||||
def pre_process(self, image):
|
def pre_process(self, image):
|
||||||
# gray = rgb2gray(image)
|
image = cv2.subtract((255, 255, 255, 0), image)
|
||||||
# from PIL import Image
|
|
||||||
# Image.fromarray(gray).show()
|
|
||||||
# image = cv2.merge([gray, gray, gray])
|
|
||||||
return image
|
return image
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user