PCL:如何在 pcl::visualizer 中更新法线的云?
PCL: How can I update the normals's cloud in pcl::visualizer?
我有一个线程,在处理点云时可以将其可视化。我还需要可视化法线,如何更新它们?
对于普通云,我找不到类似updateClouds的内容。
void pclVisualizerThread::operator()()
{
// prepare visualizer named "viewer"
while (!viewer_->wasStopped ())
{
viewer_->spinOnce (100);
// Get lock on the boolean update and check if cloud was updated
boost::mutex::scoped_lock updateLock(*(updateModelMutex_.get()));
if((*update_))
{
// I NEED ALSO TO UPDATE THE NORMALS
if(!viewer_->updatePointCloud(cloud_, "Triangulated points"))
{
viewer_->addPointCloud<pcl::PointXYZRGB>(cloud_, *rgb_, "Triangulated points");
viewer_->setPointCloudRenderingProperties (pcl::visualization::PCL_VISUALIZER_POINT_SIZE, 1, "Triangulated points");
}
(*update_) = false;
}
updateLock.unlock();
}
}
提前谢谢。
一种方法是移除法线的云并再次添加它:
void pclVisualizerThread::operator()()
{
// prepare visualizer named "viewer"
while (!viewer_->wasStopped ())
{
viewer_->spinOnce (100);
// Get lock on the boolean update and check if cloud was updated
boost::mutex::scoped_lock updateLock(*(updateModelMutex_.get()));
if((*update_))
{
if(!viewer_->updatePointCloud(cloud_, "Triangulated points"))
{
viewer_->addPointCloud<pcl::PointXYZRGB>(cloud_, *rgb_, "Triangulated points");
viewer_->setPointCloudRenderingProperties (pcl::visualization::PCL_VISUALIZER_POINT_SIZE, 1, "Triangulated points");
}
viewer_->removePointCloud("normals", 0);
viewer_->addPointCloudNormals<pcl::PointXYZRGB, pcl::Normal> (cloud_, normals_, 150, 0.35, "normals");
(*update_) = false;
}
updateLock.unlock();
}
}
相关文章:
- 从C++本机插件更新Vector3数组
- QGraphicsPolygonItem在拖动时未更新QPolygonF坐标
- cmake更新缓存的变量
- 更新到莫哈韦后出现cmath错误
- OpenMP:并行更新数组总是需要减少数组吗
- 为什么我的变量没有更新,我的 LED 没有亮起?
- 指针没有更新它在void函数内部指向的值
- 如何在c++中获取要更新的值
- 已修改的LinkedList未在文本文件本身中更新
- Qt:当QListView获得新条目时,如何更新QStringList
- 更新的矢量元素不打印
- 如何使用按钮更新GTK3图像以使用C++从相机捕获图片
- 如何在ECS框架中更新组件数据和通知系统
- 从VS 2015更新3更新到VS2015更新3 d后浮点计算行为不同的原因
- 如果我想在没有更新编译器的情况下使用新功能,该怎么办?
- 如何在 C++11 中查找和更新向量中的一个嵌套结构
- (SFML)按下键时,播放器构造函数未使用正确的动画进行更新
- 在 emscripten 网页汇编正在运行期间更新进度条?
- 在运行时使用范围更新结果
- PCL:如何在 pcl::visualizer 中更新法线的云?