• 欢迎浏览“String me = Creater\忠实的资深Linux玩家;”,请文明浏览,理性发言,有侵犯你的权益请邮件我(creater@vip.qq.com).
  • 把任何的失败都当作一次尝试,不要自卑;把所有的成功都想成是一种幸运,不要自傲。
  •    4年前 (2015-01-13)  dsp |   抢沙发  21 
    文章评分 0 次,平均分 0.0

    Could you describe in more detail what you want the grey image format to be?

    If you just want a luminance/brightness value for each pixel than you can just strip the Y values out of the existing YCbCr buffer for processing which would give you an array of byte values, one for each pixel, where the value represents the brightness of the pixel. I am not sure I understand why you want to convert to a RGB888 format if all you require is a grey version of the image.

    In the code example here on the wiki there is actually a function that will take a YCbCr buffer and make it appear greyscale by wiping out all the color data, you could do a similar operation to make a buffer greyscale data in the format you are trying to work with.

    //make the image greyscale by setting all chrominance to 0x80
    void process_imagebw( void* currentFrame,  int yRows, int xPixels)
    {
       
     int xx = 0;
     
         for( xx = 0; xx < (yRows * xPixels)*2; xx+=2 )//just operating on the chroma
          {
    
                *( ( (unsigned char*)currentFrame ) + xx ) = 0x80; //set all chroma to midpoint 0x80
             }
    
     
    } // End process_imagebw()

    参考文献:
    1.http://e2e.ti.com/search?q=YUV422
    2.http://e2e.ti.com/support/dsp/davinci_digital_media_processors/f/99/p/6155/23101#23101
    3.http://e2e.ti.com/support/dsp/davinci_digital_media_processors/f/100/p/8521/34684#34684
    4.http://e2e.ti.com/support/dsp/davinci_digital_media_processors/f/99/t/121390
    5.http://www.filtermeister.com/wiki/index.php?page=RGB+to+Grayscale+Conversion
    6.http://processors.wiki.ti.com/index.php?title=Accessing_pixels_in_a_frame_on_DM643x

     

    除特别注明外,本站所有文章均为String me = "Creater\忠实的资深Linux玩家";原创,转载请注明出处来自http://unix8.net/home.php/3949.html

    关于

    发表评论

    暂无评论

    切换注册

    登录

    忘记密码 ?

    切换登录

    注册

    扫一扫二维码分享