• 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
    
    https://msdn.microsoft.com/en-us/library/ff569191%28v=vs.85%29.aspx
  • 相关阅读:
    JVM类加载器
    Java类加载过程
    进程间8种通信方式详解
    SpringCloud教程(Finchley版本)-00:什么是SpringCloud
    pyinstaller打包web项目
    Type javax.xml.bind.JAXBContext not present
    Cannot execute request on any known server
    websocket原理
    falsk模板jinja2与Vue冲突解决方案
    关于springboot Error resolving template之类问题
  • 原文地址:https://www.cnblogs.com/artestlove/p/4655459.html
Copyright © 2020-2023  润新知