GrayScale Vs YUV comparaison
In some comments on previous questions, people told me that Y
value of a YUV
image converted using:
image_in_yuv=cv2.cvtColor(image_in_bgr,cv2.COLOR_BGR2YUV)
is the same as the L value of the same image in its grayscale color space converted using
image_in_grayscale=cv2.imred('image.png',cv2.IMREAD_GRAYSCALE)
I wonder how is this true ? because on my side when I run for example:
print image_in_yuv[200,200,0] # Y will be printed
print image_in_grayscale[200,200] # L will be printed
I get different values of Y and L for the pixel (200,200)
So did I misunderstand something ?
Just tested it and seems you are right, so might be a bug, but I know too less about color-spaces (esp. about YUV which seems to have different standards etc.)
Are you using OpenCV3? Have you tried
COLOR_RGB2YUV
? Or read it color and convert to gray? Verify and if there is a bug, you shall mention it for correction. On wiki, they say that "luminance is denoted by Y"@thdrksdfthmn: I have tried both variants
Y and L are definitely not the same at all. May be in meanings, but not precisely in practice.
Definitely a bug, this should be fixed...
@thdrksdfthmn this can not be a bug at all.
The theory says that Y is luminance and gray-level is luminance (see wiki); so y != gray-level is a bug