I have these lists containing blue values in RGB format.
low = [
[0, 0, 128],
[65, 105, 225],
[70, 130, 180],
[72, 61, 139],
[83, 104, 120]
]
What I want to make is this: convert all the values from, for example, first list from RGB to HSV.
I made this code:
import cv2
import numpy as np
for v in low:
rgb = np.uint8([[v]])
print("RGB: ", rgb)
hsv = cv2.cvtColor(rgb, cv2.COLOR_RGB2HSV)
print("HSV: ", hsv)
print("\n")
The problem is when I go to check if the colors (RGB-HSV) are the same. Here I discovered that it's not.
Let's take the last value from low
list.
RGB: [[[ 83 104 120]]]
HSV: [[[103 79 120]]]
RGB is RGB input value and HSV is output. But this last one it's not the same color as RGB. First is a shade of blue and last is green. Why?
I used this tool to check values. It also says that the right HSV for this RGB should be 205, 30, 47
.
Where is my mistake?