Conversion formula from RGB to YCbCr

不羁岁月 提交于 2021-01-21 08:04:22

问题


Whats the real conversion formula for this because I found so many ways on how to convert I don't know which one is real

From wikipedia:

From microsoft https://msdn.microsoft.com/en-us/library/ff635643.aspx :

and microsoft is the same with this conversion site http://www.equasys.de/colorconversion.html:

Can anybody explain the difference of the formula?


回答1:


If it still actual they are almost the same. Differences are what value ranges you'll get in the result.

From Wiki's matrix (R',G',B' = 0..1) values will be: Y = 0..219, Cb = -112..112, Cr = -112..112. You can bring it to other matrices with dividing Y formula by 219, and Cb, Cr fomulas by 224.

From Microsoft's one (R,G,B = 0..255) you'll get Y = 0..255, Cb ≈ -127.5 .. 127.5, Cr ≈ -127.5 .. 127.5

The third matrix solves problems with negative numbers by adding 128 to them. The difference from Microsoft's matrix lies in the matrices multiplication.



来源:https://stackoverflow.com/questions/35595215/conversion-formula-from-rgb-to-ycbcr

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!