How to process a 24-bit 3 channel color image with

2019-02-07 18:43发布

I just started to use SS2 optimization of image processing, but for the 3 channel 24 bit color images have no idea. My pix data arranged by BGR BGR BGR ... ,unsigned char 8-bi, so if I want to implement the Color2Gray with SSE2/SSE3/SSE4's instruction C/C++ fun ,how would I do? Does need to align(4/8/16) for my pix data? I have read article:http://supercomputingblog.com/windows/image-processing-with-sse/ But it is ARGB 4 channel 32-bit color,exactly process 4 color pix data every time. Thanks!

//Assume the original pixel:
      unsigned char* pDataColor=(unsigned char*)malloc(src.width*src.height*3);//3

  //init pDataColor every pix val
  // The dst pixel:
  unsigned char* pDataGray=(unsigned char*)malloc(src.width*src.height*1);//1 

//RGB->Gray: Y=0.212671*R + 0.715160*G + 0.072169*B

2条回答
萌系小妹纸
2楼-- · 2019-02-07 19:19

I have slides on de-interleaving of 24-bit RGB pixels, which explain how to do it with SSE2 and SSSE3.

查看更多
劳资没心,怎么记你
3楼-- · 2019-02-07 19:24

Here is some answers to your question:

查看更多
登录 后发表回答