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

asked 2020-03-27 13:25:23 -0500

scriptdiddy gravatar image

updated 2020-03-27 13:44:20 -0500

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_RGB2YUV)

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

edit retag flag offensive close merge delete