Displaying 1 result from an estimated 1 matches for "rgb2ycbcr".
2009 Jun 16
2
YCbCr <-> RGB conversion question
...I coded some routines for YCbCr <-> RGB conversion, both using
floating point numbers and using integer arithmetics, code is
attached.
Let's say I want to convert from RGB to YCbCr and back. First the
integer arithmetics:
In [1]: from colors import *
In [2]: a = [255, 0, 255]
In [3]: RGB2YCbCr(a)
Out[3]: (107, 202, 222)
In [4]: YCbCr2RGB(RGB2YCbCr(a))
Out[4]: array([255, 1, 255])
As you can see, the G component was increased from 0 to 1. Those
routines are the same as here:
http://msdn.microsoft.com/en-us/library/ms893078.aspx
Now let's try floating point conversions:
In [3]:...