Skip to content

Instantly share code, notes, and snippets.

@RyanParsley
Created March 17, 2016 22:11
Show Gist options
  • Select an option

  • Save RyanParsley/4e6a36c5d885e460a354 to your computer and use it in GitHub Desktop.

Select an option

Save RyanParsley/4e6a36c5d885e460a354 to your computer and use it in GitHub Desktop.
make an image black and white and draw a line on it. I'm not really sure why
import cv2
import numpy as np
from matplotlib import pyplot as plt
img = cv2.imread('watch.jpg',cv2.IMREAD_GRAYSCALE)
plt.imshow(img, cmap = 'gray', interpolation = 'bicubic')
plt.xticks([]), plt.yticks([]) # to hide tick values on X and Y axis
plt.plot([200,300,400],[100,200,300],'c', linewidth=5)
plt.show()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment