1
A
回答
1
我发现这是解决我的问题......
我没有发现比硬编码它,如果任何人有一个更好的方法,请让我知道其他的方式。
http://www.pages.drexel.edu/~nk752/depthMapTut.html#Step%204
for (row = 0; row < H; row++) {
for (col = 0; col < W; col++) {
i = (unsigned long)(row*3*W + col*3);
tempDepth = depthMapReal[row/increment][col/increment];
if(tempDepth < 43){
depthRed = tempDepth * 6;
depthGreen = 0;
depthBlue = tempDepth * 6;
}
if(tempDepth > 42 && tempDepth < 85){
depthRed = 255 - (tempDepth - 43) * 6;
depthGreen = 0;
depthBlue = 255;
}
if(tempDepth > 84 && tempDepth < 128){
depthRed = 0;
depthGreen = (tempDepth - 85) * 6;
depthBlue = 255;
}
if(tempDepth > 127 && tempDepth < 169){
depthRed = 0;
depthGreen = 255;
depthBlue = 255 - (tempDepth - 128) * 6;
}
if(tempDepth > 168 && tempDepth < 212){
depthRed = (tempDepth - 169) * 6;
depthGreen = 255;
depthBlue = 0;
}
if(tempDepth > 211 && tempDepth < 254){
depthRed = 255;
depthGreen = 255 - (tempDepth - 212) * 6;
depthBlue = 0;
}
if(tempDepth > 253){
depthRed = 255;
depthGreen = 0;
depthBlue = 0;
}
*(m_destinationBmp + i) = depthBlue;
*(m_destinationBmp + i + 1) = depthGreen;
*(m_destinationBmp + i + 2) = depthRed;
}
}
break;
}
相关问题
- 1. 如何生成128个不同的RGB颜色(int,int,int)?
- 2. 地图对象保存点(int x,int y)和颜色
- 3. 世界地图 - 国家地图半不同颜色
- 4. 同一图中的不同颜色条
- 5. Seaborn图表颜色与调色板指定的颜色不同
- 6. 相同的图像数据看起来不同,相同的颜色地图
- 7. 不同颜色
- 8. 颜色绘制不同的颜色matplotlib
- 9. 地块与集线颜色与显示颜色略有不同
- 10. 谷歌地图API V3不同的颜色标记W/CoffeeScript的
- 11. 的Python matplotlib倒钩/颤动地图的颜色不同组值
- 12. 列表视图中具有不同颜色的颜色
- 13. matplotlib的颜色地图
- 14. 将颜色与纹理颜色不同
- 15. ActionBar中图标的不同颜色
- 16. 更改不同值的图表颜色
- 17. NSTableViewCell用不同的颜色和图标
- 18. 使用不同的颜色在图表
- 19. 不同主题的图标颜色
- 20. 不同颜色条的子图
- 21. 图片显示不同的颜色
- 22. 使条形图不同的颜色
- 23. Primefaces条形图中的不同颜色
- 24. 不同颜色的直方图-matlab
- 25. 移动上的不同图层颜色
- 26. 谷歌图,不同的颜色各条
- 27. 如何使不同颜色的热图
- 28. 不同颜色的路径绘图
- 29. 柱形图的不同颜色
- 30. 谷歌地图V3 - Muliple标签 - 不同的颜色
告诉我们您的编程环境。语言?图书馆?操作系统? – 2012-03-04 19:35:55
我更新了这些信息,谢谢! – 2012-03-04 19:36:49