Ask Your Question

Revision history [back]

Convert RGB array to YUV422 4:2:2 in Python

I need to convert a RGB uint8 720x480x3 numpy array into a YUV422 uint8 720x480x2 array. How can I do this with OpenCV? If OpenCV doesn't support it, is there another Python framework that will?

I assume I can convert an RGB to YUV using the standard CV2 conversion

im_yuv = cv2.cvtColor(im_np, cv2.COLOR_BGR2YUV)

And then do the subsampling? I need the output to be 720x480x2. Any help would be greatly appreciated!

Convert RGB array to YUV422 4:2:2 in Python

I need to convert a RGB uint8 720x480x3 numpy array into a YUV422 uint8 720x480x2 array. How can I do this with OpenCV? If OpenCV doesn't support it, is there another Python framework that will?

I assume I can convert an RGB to YUV using the standard CV2 conversion

im_yuv = cv2.cvtColor(im_np, cv2.COLOR_BGR2YUV)cv2.COLOR_RGB2YUV)

And then do the subsampling? I need the output to be 720x480x2. Any help would be greatly appreciated!