读取pcd文件数据

读取pcd文件数据

QStringList lineStrs = lineStr.split(" ");

float x_value = lineStrs[0].toFloat();
float y_value = lineStrs[1].toFloat();
float z_value = lineStrs[2].toFloat();
float rgb_value = lineStrs[3].toFloat();

int nrgb = *reinterpret_cast<int*>(&rgb_value);
int r_value = (nrgb >> 16) & 0x0000ff;
int g_value = (nrgb >> 8) & 0x0000ff;
int b_value = (nrgb)& 0x0000ff;

                

 

也可以根据pcd数据直接绘制出彩色图

 

 

 

####################

posted @ 2022-03-04 10:01  西北逍遥  阅读(212)  评论(0编辑  收藏  举报