2

I can not find a definitive answer to the difference between YUV and YCrCb color spaces. nVidia’s performance primitives and OpenCV have different functions and constants that indicate that they are different. For example, OpenCV’s cvtColor() function has separate codes CV_RGB2YCrCb and CV_RGB2YUV — what is the difference? The formula documented for OpenCV’s RGB to YCrCb transformation is given as

enter image description here

Where the RGB to YUV as explained on Wikipedia is

enter image description here

Note that the CrCb channels appear to be backwards to UV channels and the constants are different. The delta’s are just normalization values.

The answer here does not really shed light on the details. Evidently the difference is rooted in historical differences between analog and digital video? When would I use one versus the other?

Edit: Take a look at the difference between U/CB and V/CR in this post and you can see there is a slight difference.

wcochran
  • 10,089
  • 6
  • 61
  • 69
  • According to Wikipedia: "Y′CbCr is often confused with the YUV color space, and typically the terms YCbCr and YUV are used interchangeably, leading to some confusion". From experience I can tell there are many more color formats referred as "YUV", with different conversion formulas. You may see YUV as a nickname for describing different things (there is no one YUV color space). – Rotem Feb 11 '20 at 22:17
  • I am thinking these slightly different YUV formats are tailored for a particular encoding method. The API's I use (NPPI, OpenCV) seem to handle exactly two flavors YUV and YCbCr (which give slight different values). In my case I am converting to NV12 (2 plane version of YUV) which is then encoded as a H264 stream. – wcochran Feb 13 '20 at 04:03

0 Answers0