ARTICLE DETAIL

资讯详情

深耕网站建设与运营推广的一线实战洞察。

点云库PCL介绍

点云库PCL介绍 点云库(Point Cloud Library, PCL)是一个用于二维/三维图像及点云处理的独立、大规模开源项目。源码地址https://github.com/pointcloudlibrary/pcl最新发布版本为1.15.1license为BSD。PCL依赖项(1).Boost必选用于共享指针和线程处理版本要求1.46.1。(2).Eigen必选用作SSE优化数学运算的矩阵后端版本要求3.0.0。(3).Flann必选用于k-d树以实现快速近似最近邻搜索版本要求1.6.8。(4).VTK必选用于三维点云渲染与可视化版本要求5.6.1。(5).Qt可选用于开发具有图形用户界面(GUI)的应用程序版本要求4.6。(6).QHull可选用于表面(surface)处理的凸/凹壳分解版本要求2011.1。(7).OpenNI可选用于从兼容OpenNI的设备获取点云版本要求1.1.0.25。(8).GTest可选用于构建测试单元版本要求1.6.0。在Windows上可通过源码编译也可直接从 https://github.com/PointCloudLibrary/pcl/releases/tag/pcl-1.15.1 下载二进制库PCL-1.15.1-AllInOne-msvc2022-win64.exe。示例代码如下int main() { pcl::PointCloudpcl::PointXYZRGB::Ptr cloud(new pcl::PointCloudpcl::PointXYZRGB); for (float x -5.0f; x 5.0f; x 0.1f) { for (float y -5.0f; y 5.0f; y 0.1f) { const float r std::sqrt(x * x y * y); pcl::PointXYZRGB point{}; point.x x; point.y y; point.z std::sin(r); const float z point.z; point.r static_caststd::uint8_t((z 1.0f) * 127.5f); point.g 100; point.b static_caststd::uint8_t((1.0f - z) * 127.5f); cloud-push_back(point); } } pcl::visualization::PCLVisualizer viewer(PCL XYZRGB Viewer); viewer.setBackgroundColor(0.1, 0.1, 0.1); viewer.addPointCloudpcl::PointXYZRGB(cloud, cloud); viewer.setPointCloudRenderingProperties(pcl::visualization::PCL_VISUALIZER_POINT_SIZE, 3, cloud); viewer.addCoordinateSystem(1.0); while (!viewer.wasStopped()) { viewer.spinOnce(10); } return 0; }执行结果如下图所示GitHubhttps://github.com/fengbingchun/3D_Test
返回列表