Quantcast
Channel: VBForums - Visual Basic 6 and Earlier
Viewing all articles
Browse latest Browse all 21251

What is the CORRECT conversion for YUV to RGB?

$
0
0
I'm writing a graphics program that needs to convert standard YUV images to RGB. The problem is that every website I see that has the YUV to RGB conversion formula, has a slightly different formula.

From http://www.fourcc.org/fccyvrgb.php

one person posted
Quote:

B = 1.164(Y - 16) + 2.018(U - 128)
G = 1.164(Y - 16) - 0.813(V - 128) - 0.391(U - 128)
R = 1.164(Y - 16) + 1.596(V - 128)

while someone else posted
Quote:

R = Y + 1.403V'
G = Y - 0.344U' - 0.714V'
B = Y + 1.770U'

And on http://www.pcmag.com/encyclopedia/te...rsion-formulas it says

Quote:

R = Y + 1.140V
G = Y - 0.395U - 0.581V
B = Y + 2.032U

I would have THOUGHT that there was one specific CORRECT way to convert YUV to RGB, but that specification appears to be long lost.

If someone here can give me a correct specification on the proper YUV to RGB conversion (including what valid range of inputs these formulas are expecting, and how the YUV data is normally stored such that I can find the proper pre-processing method to use on the YUV data prior to performing the YUV to RGB conversion) I'd be VERY grateful.

Viewing all articles
Browse latest Browse all 21251

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>