PyImageSearch / imutils

A series of convenience functions to make basic image processing operations such as translation, rotation, resizing, skeletonization, and displaying Matplotlib images easier with OpenCV and Python.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

let opencv2matplotlib work with float images as well

johnnewto opened this issue · comments

def opencv2matplotlib(image):
# OpenCV represents images in BGR order; however, Matplotlib
# expects the image in RGB order, so simply convert from BGR
# to RGB and return
# return cv2.cvtColor(image, cv2.COLOR_BGR2RGB)
return image[...,::-1] # to also work with float images