2
$\begingroup$

$ \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.

  • 0
    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.2012-01-26

1 Answers 1

2

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)