问题1
《点云库PCL从入门到精通》第五章 2 range_image_visualization 可视化深度图像例程时
编译器报错"camera_":不是"pcl::visualization::PCLVisualizer"的成员,报错代码如下:
viewer.camera_.pos[0] = pos_vector[0]; viewer.camera_.pos[1] = pos_vector[1]; viewer.camera_.pos[2] = pos_vector[2]; viewer.camera_.focal[0] = look_at_vector[0]; viewer.camera_.focal[1] = look_at_vector[1]; viewer.camera_.focal[2] = look_at_vector[2]; viewer.camera_.view[0] = up_vector[0]; viewer.camera_.view[1] = up_vector[1]; viewer.camera_.view[2] = up_vector[2];
解决:PCL1.8的viewer已经没有camera_了,应使用函数setCameraPosition()替换。修改后的代码如下:
viewer.setCameraPosition(pos_vector[0], pos_vector[1], pos_vector[2], look_at_vector[0], look_at_vector[1], look_at_vector[2], up_vector[0], up_vector[1], up_vector[2]);