components.colourspace.rgbtoyuv

class RGBtoYUV(config={}, **kwds)[source]

Bases: Component

RGB to YUV (YCbCr) converter.

Convert RGB frames to “YUV” (actually YCbCr) with 4:4:4 sampling.

The matrix config item chooses the matrix coefficient set. It can be '601' (”Rec. 601”, standard definition) or '709' (”Rec. 709”, high definition). In 'auto' mode the matrix is chosen according to the number of lines in the image.

If you are going to recombine the Y and UV outputs later on it makes sense to omit the audit trail from one of the outputs, using the audit config to choose which output will have the full audit trail. This avoids unnecessary duplication.

WARNING: this component assumes RGB input and Y output both have black level 0 and white level 255, not the 16..235 range specified in Rec 601. See pyctools.components.colourspace.levels for components to convert the RGB input or Y output. The UV output is in the range -112..112.

outputs = ['output_Y', 'output_UV']

Comments or questions? Please email jim@jim-easterbrook.me.uk.