Skip to content

Instantly share code, notes, and snippets.

View f0ti's full-sized avatar

Foti Kerkeshi f0ti

  • AI, Universiteit Maastricht
  • The Netherlands
View GitHub Profile
@f0ti
f0ti / rgbbgr
Created December 21, 2020 21:25
RGB2BGR, BGR2RGB
import cv2
import numpy as np
from PIL import Image
def RGB2BGR(image):
return cv2.cvtColor(np.array(image), cv2.COLOR_RGB2BGR)
def BGR2RGB(image):
return Image.fromarray(cv2.cvtColor(image, cv2.COLOR_BGR2RGB))