在YUV色彩空间中处理图像

Processing in the 8-bit YUV Color Space

Working in the YUV color space simplifies the calculations involved for ProcAmp adjustment control of a video stream.

Y Processing

To perform ProcAmp adjustment for the Y component, subtract 16 from the Y value to position the black level at zero. This removes the DC offset so that adjusting the contrast does not vary the black level. Because Y values might be less than 16, negative Y values should be supported at this point. Contrast is adjusted by multiplying the YUV pixel values by a constant. If U and V are not adjusted, a color shift will result whenever the contrast is changed. The brightness property value is added (or subtracted) from the contrast adjusted Y values; this is done to avoid introducing a DC offset due to adjusting the contrast. Finally, the value 16 is added to reposition the black level at 16.

The following equation summarizes the steps described in the previous paragraph. C is the contrast value and B is the brightness value.

Y' = ((Y - 16) x C) + B + 16

UV Processing

To perform ProcAmp adjustment for the U and V components, subtract 128 from both U and V values to position the range around zero. The hue property is implemented by mixing the U and V values together as shown in the following equations. H is the desired hue angle:

U' = (U-128) x Cos(H) + (V-128) x Sin(H)
V' = (V-128) x Cos(H) - (U-128) x Sin(H)

Saturation is adjusted by multiplying U' and V' by a pair of constants, and then by adding 128 to each. The combined processing of hue and saturation on the UV data is shown in the following equations. H is the desired hue angle, C is the contrast value, and S is the saturation value:

U'' = (((U-128) x Cos(H) + (V-128) x Sin(H)) x C x S) + 128
V'' = (((V-128) x Cos(H) - (U-128) x Sin(H)) x C x S) + 128


评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值