Skip to content

Instantly share code, notes, and snippets.

@sandeepraju
Created February 27, 2016 08:51
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save sandeepraju/b18e74ec066ed13dac28 to your computer and use it in GitHub Desktop.
Save sandeepraju/b18e74ec066ed13dac28 to your computer and use it in GitHub Desktop.
No nonsense image preview in opencv while using ipython
import cv2
# load the image
img = cv2.imread("Lenna.png")
# start a new window thread (doesn't block your ipython
# prompt since this is on a different thread)
cv2.startWindowThread()
cv2.namedWindow("preview")
# using the window to display an image
cv2.imshow("preview", img)
# to close all windows
cv2.destroyAllWindows()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment