Ask Your Question

JohneyWood's profile - activity

2018-11-19 23:58:54 -0600 received badge  Student (source)
2018-11-19 17:37:18 -0600 commented question cv2.COLOR_RGB2HSV is not giving correct HSV values

very helpful, thank you

2018-11-19 17:37:17 -0600 commented answer cv2.COLOR_RGB2HSV is not giving correct HSV values

Thanks, I got it now. So I should be expecting 60/2 = 30, which is the value that opencv gives me.

2018-11-19 16:54:07 -0600 received badge  Supporter (source)
2018-11-19 16:54:05 -0600 marked best answer cv2.COLOR_RGB2HSV is not giving correct HSV values

Hi, I ran a very simple code as below to convert RGB to HSV, but opencv is giving me incorrect answers. I want to convert yellow from RGB [255,255,0] to HSV, which should give me a value of [60,100,100] or [60,255,255]. However, it is giving me [30,255,255]. Later I tried to use cv2.COLOR_BRG2HSV, it is giving me [90,255,255]. None of these is the correct answer, why?? I'm using macOS Mojave (10.14), Anaconda 1.9.2, python 3.6.4, opencv 3.4.1.

Code:

import numpy as np

import cv2

a = [255,255,0]

HSV_convert = cv2.cvtColor(np.uint8([[a]]), cv2.COLOR_BGR2HSV)

print(HSV_convert)

2018-11-19 16:54:05 -0600 received badge  Scholar (source)
2018-11-17 18:37:06 -0600 asked a question cv2.COLOR_RGB2HSV is not giving correct HSV values

cv2.COLOR_RGB2HSV is not giving correct HSV values Hi, I ran a very simple code as below to convert RGB to HSV, but open