mirror of
https://github.com/qurator-spk/eynollah.git
synced 2025-06-08 19:59:56 +02:00
cv2pil: do COLOR_BGR2RGB conversion
This commit is contained in:
parent
c7f304dcb6
commit
ff265eee5c
1 changed files with 2 additions and 2 deletions
|
@ -1,12 +1,12 @@
|
||||||
from PIL import Image
|
from PIL import Image
|
||||||
import numpy as np
|
import numpy as np
|
||||||
from ocrd_models import OcrdExif
|
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
|
# from sbb_binarization
|
||||||
|
|
||||||
def cv2pil(img):
|
def cv2pil(img):
|
||||||
return Image.fromarray(img)
|
return Image.fromarray(np.array(cvtColor(img, COLOR_BGR2RGB)))
|
||||||
|
|
||||||
def pil2cv(img):
|
def pil2cv(img):
|
||||||
# from ocrd/workspace.py
|
# from ocrd/workspace.py
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue