Skip to content

Instantly share code, notes, and snippets.

@cancan101
Last active August 29, 2015 14:01
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 cancan101/aca55ff569cb790d7757 to your computer and use it in GitHub Desktop.
Save cancan101/aca55ff569cb790d7757 to your computer and use it in GitHub Desktop.
OpenCV Image Utilities
def get_bw(src):
return cv2.cvtColor(src, cv2.COLOR_BGR2GRAY)
def show_color(src):
plt.imshow(cv2.cvtColor(src, cv2.COLOR_BGR2RGB))
_ = plt.xticks([]), plt.yticks([])
def show_bw(bw):
plt.imshow(bw, cmap='gray')
_ = plt.xticks([]), plt.yticks([])
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment