Skip to content

Instantly share code, notes, and snippets.

@saurabhpal97
Created March 23, 2019 09:26
Show Gist options
  • Save saurabhpal97/686befba7713f0c601cf96088cf3f195 to your computer and use it in GitHub Desktop.
Save saurabhpal97/686befba7713f0c601cf96088cf3f195 to your computer and use it in GitHub Desktop.
#import the required libraries
import numpy as np
import matplotlib.pyplot as plt
import cv2
%matplotlib inline
image = cv2.imread('index.jpg')
#converting image to Gray scale
gray_image = cv2.cvtColor(image,cv2.COLOR_BGR2GRAY)
#plotting the grayscale image
plt.imshow(gray_image)
#converting image to HSV format
hsv_image = cv2.cvtColor(image,cv2.COLOR_BGR2HSV)
#plotting the HSV image
plt.imshow(hsv_image)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment