原创]基于CUDA的图像亮度直方图统计 转载
摘要:
http://blog.21ic.com/user1/5184/archives/2009/61678.html算法:1、先计算原始图像每个像素的亮度:u = (unsigned char)(0.299f * r + 0.587f * g + 0.114f * b)。2、用一个256大小的数组统计每个亮度的点的数量。C++实现方法:memset(out, 0, sizeof(out));unsigned long offset;unsigned long p;unsigned char r, g, b, u;offset = 0;for(y = 0; y < h; y ++) for(x 阅读全文
posted @ 2011-08-09 16:04 kyleada 阅读(864) 评论(0) 推荐(0) 编辑