From ff265eee5c52647299c5e1549430ed93af6c56a9 Mon Sep 17 00:00:00 2001 From: Konstantin Baierer Date: Thu, 22 Apr 2021 12:57:04 +0200 Subject: [PATCH] cv2pil: do COLOR_BGR2RGB conversion --- qurator/eynollah/utils/pil_cv2.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/qurator/eynollah/utils/pil_cv2.py b/qurator/eynollah/utils/pil_cv2.py index d6eb0f3..4d180f5 100644 --- a/qurator/eynollah/utils/pil_cv2.py +++ b/qurator/eynollah/utils/pil_cv2.py @@ -1,12 +1,12 @@ from PIL import Image import numpy as np from ocrd_models import OcrdExif -from cv2 import COLOR_GRAY2BGR, COLOR_RGB2BGR, cvtColor, imread +from cv2 import COLOR_GRAY2BGR, COLOR_RGB2BGR, COLOR_BGR2RGB, cvtColor, imread # from sbb_binarization def cv2pil(img): - return Image.fromarray(img) + return Image.fromarray(np.array(cvtColor(img, COLOR_BGR2RGB))) def pil2cv(img): # from ocrd/workspace.py