Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

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)

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 ?

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 ?

click to hide/show revision 3
retagged

updated 2015-03-19 04:18:21 -0600

berak gravatar image

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 ?