OpenGL处理点云问题

a56508820 2013-11-09 03:21:10
使用激光扫描仪扫描数据点,再使用OpenGL对点云进行处理,我自己写的程序显示效果(上)与激光扫描仪配套的处理软件的显示效果(下)如下图


我需要怎么做才能把显示效果跟下图显示一样呢,我是使用扫描仪的SDK获得点云的坐标和光强。获取点的API如下:
HRESULT getScanPoint([in] int scan, [in] int row, [in] int col, [out] double* x, [out] double* y, [out] double* z, [out] int* color, [out, retval] int* result)
Get the point at the given row/column in the given scan. The result is in the local cartesian coordinate system of the scanner. The returned color value depends on the selected reflection mode:
0. For grey scan points: Original reflection value of the scanner. In the case of
an FARO Laser Scanner this isin the range of 0 to 2047.
For color: the lightness of the color in the range 0 to 255.
1. For grey scan points: Mapped reflection value is in the range 0 (black) to
255 (white).
For color: the lightness of the color in the range 0 to 255.
2. For grey scan points: Mapped reflection value is in the range 0 (black) to
255 (white) as RGB grey value.
For color: RGB color, 8 bits per channel (bits 0-7: red, bits 8-15: green, bits
16-23: blue).
The default reflection mode is 1.
The scan number can be in the range 0 to numScans-1.
我是使用灰度扫描的,所以获取的color是一个灰度值,请问我怎么给一个点设置它的灰度值,我是一个新手,很多都不会,希望各位能帮一下,谢谢
...全文
494 2 打赏 收藏 转发到动态 举报
写回复
用AI写文章
2 条回复
切换为时间正序
请发表友善的回复…
发表回复
a56508820 2013-11-09
  • 打赏
  • 举报
回复
引用 1 楼 jiangcaiyang123 的回复:
给一个点设置灰度值?那么在glColor3()中设定红、绿、蓝分量为同一值就行了。
谢谢,你是对的,我之前没有留意浮点数的问题
彩阳 2013-11-09
  • 打赏
  • 举报
回复
给一个点设置灰度值?那么在glColor3()中设定红、绿、蓝分量为同一值就行了。

19,468

社区成员

发帖
与我相关
我的任务
社区描述
VC/MFC 图形处理/算法
社区管理员
  • 图形处理/算法社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧