Mathematics Stack Exchange is a question and answer site for people studying math at any level and professionals in related fields. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

$$ \begin{pmatrix} Y \\ Cb \\ Cr \end{pmatrix} = \mathrm{Round} \left\{ \begin{pmatrix} 0.2126\times\frac{219}{255} & 0.7152\times\frac{219}{255} & 0.0722\times\frac{219}{255} \\ -\frac{0.2126}{1.8556}\times\frac{224}{255} & -\frac{0.7152}{1.8556}\times\frac{224}{255} & 0.5\times\frac{224}{255} \\ 0.5\times\frac{224}{255} & -\frac{0.7152}{1.5748}\times\frac{224}{255} & -\frac{0.0722}{1.5748}\times\frac{224}{255} \end{pmatrix} \begin{pmatrix} R \\ G \\ B \end{pmatrix} \right\} + \begin{pmatrix} 16 \\ 128 \\ 128 \end{pmatrix} $$

Is it possible to derive formula from above matrix that converts YCbCr to RGB? I am newbie to maths.

I have YCbCr value already available, I want to convert it to RGB.

share|cite|improve this question
You should be able to translate the formulae in the wiki page to matrix format... – J. M. Oct 27 '10 at 12:06
I interpreted his question as asking how to invert that transformation in his linked equation; hence the wiki entry containing the YCbCr▶RGB conversion, which can be translated to a matrix-vector format if one wishes. As it stands, I don't know how to invert something that has the rounding function in it. :) – J. M. Oct 27 '10 at 13:11
@J.M.: You're right, I misread the question. I shouldn't be browsing this site late at night... :-/ – Rahul Oct 27 '10 at 18:28
The round function just round up or down the number? if that is the case, just take it out and then it not hard to do. – yiyi Jan 26 '12 at 19:03

This is just a linear matrix. All you need is to do a complete reverse. (This will not take into the account Round part)

So let:

C - you YCbCr matrix
M - be your transformation matrix (the one with a lot of math inside)
V - your [16 128 128]' vector
R - your RBG matrix

So your starting formula is:

C = round( M * R ) + V

So in reverse this will be

R = M^(-1) * (C - V)
share|cite|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.