Created
December 4, 2016 02:00
-
-
Save vijay120/b3e7f5adcd90bc04679561e08cf62856 to your computer and use it in GitHub Desktop.
This file contains 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
def grayscale(img): | |
"""Applies the Grayscale transform | |
This will return an image with only one color channel | |
but NOTE: to see the returned image as grayscale | |
you should call plt.imshow(gray, cmap='gray')""" | |
return cv2.cvtColor(img, cv2.COLOR_BGR2GRAY) | |
image = mpimg.imread('test_images/solidYellowCurve2.jpg') | |
# grayscale the image | |
grayscaled = grayscale(image) | |
plt.imshow(grayscaled, cmap='gray') |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment