Skip to content

Instantly share code, notes, and snippets.

display opencv image using matplotlib in ipython notebook
Raw
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@zori
Copy link
Author

zori commented Sep 4, 2018

For flipping BGR -> RGB one could do img2 = img[:, :, ::-1] where img is the color image (read by imread) but it feels hacky, so I like the self-documented solution.

img = cv2.imread('img.jpg')
img2 = img[:, :, ::-1]
plt.imshow(img)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment