Last active
January 24, 2019 15:19
-
-
Save oak-tree/4ed7e1399a22f29dddfd748bc8e6f17d to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import numpy as np | |
import matplotlib.pyplot as plt | |
import matplotlib.image as mpimg | |
def do_something(img): | |
return np.dot(img[...,:3], [0.299, 0.587, 0.114]) | |
img = mpimg.imread('image.png') | |
result = do_something(img) | |
plt.imshow(result, cmap = plt.get_cmap('gray')) | |
plt.show() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment