我刚开始用SS2优化图像处理,但是对于3通道24位的彩色图像还没有概念。我的像素数据由BGR ...,unsigned char 8-bi排列,所以如果我想用sse2/sse3/sse4的指令C/C++ fun来实现Color2Gray,我该怎么做?我的像素数据需要对齐(4/8/16)吗?我曾经读过一篇文章:http://supercomputingblog.com/windows/image-processing-with-sse/,但它是ARGB4通道32位色,每次精确处理4色像素数据。谢谢!
//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->灰色: Y=0.212671*R + 0.715160*G + 0.072169*B
发布于 2013-03-13 12:58:43
我在de-interleaving of 24-bit RGB pixels上有一些幻灯片,其中解释了如何使用SSE2和SSSE3来做这件事。
发布于 2013-03-13 12:29:33
以下是您问题的一些答案:
用于对齐的
https://stackoverflow.com/questions/15376780
复制相似问题