tags:

views:

681

answers:

2

How to perform RGB->YUV conversion in C/C++?

I have some Bitmap.. RGB I need to convert it to YUV

Libs? Tuts? Articles?

+1  A: 

ImageMagick?

John Paulett
+2  A: 

Check this article: http://www.fourcc.org/fccyvrgb.php Conversion is quite easy so you probably could write your own function based on this

Y  =      (0.257 * R) + (0.504 * G) + (0.098 * B) + 16

Cr = V =  (0.439 * R) - (0.368 * G) - (0.071 * B) + 128

Cb = U = -(0.148 * R) - (0.291 * G) + (0.439 * B) + 128

Answered 4 mins ago
santod
46●1

voyager
Hi Voyager i need some help i have dumped my code which is yv12->rgb565. In the same way i have to perform for yuv444 to rgb888. Please guide me. Please u can look my latest question for the function which converts yuv12->rgb565
Abhi