How to Convert RGB to YUV(NV21)

asked 2019-01-21 21:05:29 -0500

Kishore gravatar image

I have loaded a Jpeg image by using [ imread ()] function. Now, I want to convert this image to YUV(NV21) format. I found that [ cvtColorTwoPlane( InputArray src1, InputArray src2, OutputArray dst, int code ) ] perform the operation YUV to RGB. So, Could you please let me know how can I convert RGB to YUV(NV21)?

Thanks in Advance.

edit retag flag offensive close merge delete

Comments

From RGB to YUV

   Y = 0.299R + 0.587G + 0.114B
   U = 0.492 (B-Y)
   V = 0.877 (R-Y)

   It can also be represented as:

   Y =  0.299R + 0.587G + 0.114B
   U = -0.147R - 0.289G + 0.436B
   V =  0.615R - 0.515G - 0.100B
supra56 gravatar imagesupra56 ( 2019-01-22 14:36:35 -0500 )edit

Here is link for android: RGB to YUV(NV2

supra56 gravatar imagesupra56 ( 2019-01-22 14:43:36 -0500 )edit