Created
February 22, 2019 11:04
-
-
Save saurabhpal97/00d28d3e7a42116f2ddd698a4b979856 to your computer and use it in GitHub Desktop.
OpenCV image reading and writing operations
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
#import the required libraries | |
import matplotlib.pyplot as plt | |
import cv2 | |
%matplotlib inline | |
#reading the image | |
image = cv2.imread('index.png') | |
#reading in grayscale format | |
grayscale_image = cv2.imread('index.png',0) | |
#plotting the image | |
plt.imshow(image) | |
#saving image | |
cv2.imwrite('test_write.jpg',image) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment