Created
May 29, 2024 18:49
-
-
Save julianoBRL/659bfaa099c0fe347f02979e77f17e57 to your computer and use it in GitHub Desktop.
Converter from RGB to HSV
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
# Python programs to find | |
# unique HSV code for color | |
# Importing the libraries openCV & numpy | |
import cv2 | |
import numpy as np | |
def RGBtoHSV(red,green,blue): | |
color = np.uint8([[[blue, green, red]]]) | |
hsv_color = cv2.cvtColor(color, cv2.COLOR_BGR2HSV) | |
return hsv_color | |
def RGBtoHSV2(red,green,blue): | |
hsv_color = RGBtoHSV(red,green,blue) | |
return hsv_color[0][0][0] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment