slevis's picture
Duplicate from s-l-s/cbir-image-similarity
ac1c6ae
raw
history blame
324 Bytes
import numpy as np
import cv2
def pil_cv2_image_converter(image):
numpy_image = np.array(image)
# Convert to an OpenCV image; notice the COLOR_RGB2BGR flag, which means
# that the color is converted from RGB to BGR format.
opencv_image = cv2.cvtColor(numpy_image, cv2.COLOR_RGB2BGR)
return opencv_image