zoukankan      html  css  js  c++  java
  • 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
  • 相关阅读:
    面向对象程序设计课第五次作业
    面向对象程序设计课第三次作业
    MeasureSpec 解析
    JavaWeb学习总结(一)JavaWeb入门与Tomcat
    Redis GetTypedClient
    Visual Studio Entity Framework (EF) 生成SQL 代码 性能查询
    EF 连接MySQL 数据库  保存中文数据后乱码问题
    VS2015 +EF6 连接MYSQL数据库生成实体
    WebConfig 自定义节点configSections配置信息
    docker菜鸟入门
  • 原文地址:https://www.cnblogs.com/artestlove/p/4655459.html
Copyright © 2011-2022 走看看