opencv rgb转YUV公式
https://docs.opencv.org/master/de/d25/imgproc_color_conversions.html#color_convert_rgb_ycrcb
RGB ↔ YCrCb JPEG (or YCC)
Y←0.299⋅R+0.587⋅G+0.114⋅B
Cr←(R−Y)⋅0.713+delta
Cb←(B−Y)⋅0.564+delta
R←Y+1.403⋅(Cr−delta)
G←Y−0.714⋅(Cr−delta)−0.344⋅(Cb−delta)
B←Y+1.773⋅(Cb−delta)
where
delta=⎧⎩⎨⎪⎪128327680.5for 8-bit imagesfor 16-bit imagesfor floating-point images
Y, Cr, and Cb cover the whole value range.