mirror of
https://github.com/LmeSzinc/StarRailCopilot.git
synced 2024-11-15 22:19:18 +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 cv2
|
||||
from pponnxcr.predict_system import BoxedResult
|
||||
|
||||
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)
|
||||
|
||||
def pre_process(self, image):
|
||||
# gray = rgb2gray(image)
|
||||
# from PIL import Image
|
||||
# Image.fromarray(gray).show()
|
||||
# image = cv2.merge([gray, gray, gray])
|
||||
image = cv2.subtract((255, 255, 255, 0), image)
|
||||
return image
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user