Skip to content

Instantly share code, notes, and snippets.

@saurabhpal97
Created February 22, 2019 11:04
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 saurabhpal97/00d28d3e7a42116f2ddd698a4b979856 to your computer and use it in GitHub Desktop.
Save saurabhpal97/00d28d3e7a42116f2ddd698a4b979856 to your computer and use it in GitHub Desktop.
OpenCV image reading and writing operations
#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