From 08a9326e843edeba1d8c9e71b03be87909be750b Mon Sep 17 00:00:00 2001 From: guoh064 <50830808+guoh064@users.noreply.github.com> Date: Sat, 26 Oct 2024 22:22:30 +0800 Subject: [PATCH] upd: [JP] EmotionDigit pre_process --- module/retire/scanner.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/module/retire/scanner.py b/module/retire/scanner.py index 5ad4605d9..c68d1d3c9 100644 --- a/module/retire/scanner.py +++ b/module/retire/scanner.py @@ -24,9 +24,11 @@ class EmotionDigit(Digit): def pre_process(self, image): if server.server == 'jp': image_gray = extract_letters(image, letter=(255, 255, 255), threshold=self.threshold) - right_side = np.nonzero(image_gray[0:16, :].min(axis=0) > 176)[-1] - image = image[:, :right_side[-1]] - + right_side = np.nonzero(image_gray[0:16, :].max(axis=0) > 192)[-1] + for i, col in enumerate(right_side): + if i < col: + break + image = image[:, :i] image = super().pre_process(image) return image