Convert an Image to HSV Using Python OpenCV

In this tutorial, we will introduce the way to convert an image to hsv using python opencv.

1. Import library

import cv2

2. Read an image

image = cv2.imread('C:/Users/N/Desktop/Test.jpg')

3. Convert image to hsv

hsvImage = cv2.cvtColor(image, cv2.COLOR_BGR2HSV)

4. Show images

cv2.imshow('Original image',image)
cv2.imshow('HSV image', hsvImage)

5. Close the window

cv2.waitKey(0)
cv2.destroyAllWindows()