当前位置: 首页 > news >正文

营销型网站建设概述网站设计培训班询

营销型网站建设概述,网站设计培训班询,设计在线观看免费2014,外贸商城网站资质本文为Windows配置点云库pcl步骤,具体win10、visual studio 2019、pcl1.11.1。 【1】下载安装包 Releases PointCloudLibrary/pcl GitHub 其中,AllInOne是一个包含了PCL库所有模块的单独下载包,方便快速获取整个PCL库,而pdb则…

本文为Windows配置点云库pcl步骤,具体win10、visual studio 2019、pcl1.11.1

【1】下载安装包

Releases · PointCloudLibrary/pcl · GitHub

 其中,AllInOne是一个包含了PCL库所有模块的单独下载包,方便快速获取整个PCL库,而pdb则是PCL库的调试信息文件,可以在程序崩溃时提供更详细的调试信息来分析解决错误。

【2】安装

2.1 先执行win64.exe

 

  建议自定义安装的位置,按提示操作即可,建议把pcl添加到PATH中。

2.2 解压win64.zip

把解压出来的子文件,全部复制到PCL/bin中

 

2.3 OpenNI2安装

 执行.msi,建议修改路径到该文件夹下;如果已安装过,建议Remove后重新安装,以便后续添加PATH和使用时路径清晰。

 

 安装完毕,该路径如下:

【3】设置环境变量

“此电脑”右键>>属性,如下图添加,再重启电脑:

 

【4】visual studio 项目实战

4.1 新建C++空项目

可设置Debug-x64

4.2 右键属性

如下图,右键 >> 属性

4.3 包含目录

如下图,编辑包含目录:

 添加如下路径(不同库的路径层级不同,建议各层级都添加避免包含错误):

D:\tools\PCL 1.11.1\include\pcl-1.11

D:\tools\PCL 1.11.1\include\pcl-1.11\pcl

D:\tools\PCL 1.11.1\3rdParty\Boost\include\boost-1_74\boost

D:\tools\PCL 1.11.1\3rdParty\Eigen\eigen3

D:\tools\PCL 1.11.1\3rdParty\Eigen\eigen3\Eigen

D:\tools\PCL 1.11.1\3rdParty\Eigen\eigen3\unsupported

D:\tools\PCL 1.11.1\3rdParty\Eigen\eigen3\unsupported\Eigen

D:\tools\PCL 1.11.1\3rdParty\FLANN\include

D:\tools\PCL 1.11.1\3rdParty\FLANN\include\flann

D:\tools\PCL 1.11.1\3rdParty\OpenNI2\Include

D:\tools\PCL 1.11.1\3rdParty\Qhull\include

D:\tools\PCL 1.11.1\3rdParty\Qhull\include\libqhull

D:\tools\PCL 1.11.1\3rdParty\Qhull\include\libqhull_r

D:\tools\PCL 1.11.1\3rdParty\Qhull\include\libqhullcpp

D:\tools\PCL 1.11.1\3rdParty\VTK\include

D:\tools\PCL 1.11.1\3rdParty\VTK\include\vtk-8.2

4.4 库目录

仿照4.3包含目录添加库目录:

D:\tools\PCL 1.11.1\lib

D:\tools\PCL 1.11.1\3rdParty\Boost\lib

D:\tools\PCL 1.11.1\3rdParty\FLANN\lib

D:\tools\PCL 1.11.1\3rdParty\OpenNI2\Lib

D:\tools\PCL 1.11.1\3rdParty\Qhull\lib

D:\tools\PCL 1.11.1\3rdParty\VTK\lib

4.5 添加附加依赖项

需要添加PCL和VTK的debug版lib,总共140多个。

可以通过以下批处理的方法:

cd\d D:\tools\PCL 1.11.1\lib  //转到lib目录

dir/b *d.lib *>0.txt                  //把debug用的d.lib后缀名字写到0.txt中

两次操作把这些名字复制粘贴到附加依赖项中。

4.6 添加.cpp并执行

#include <iostream>
#include <thread>#include <pcl/console/parse.h>
#include <pcl/point_cloud.h> // for PointCloud
#include <pcl/common/io.h> // for copyPointCloud
#include <pcl/point_types.h>
#include <pcl/sample_consensus/ransac.h>
#include <pcl/sample_consensus/sac_model_plane.h>
#include <pcl/sample_consensus/sac_model_sphere.h>
#include <pcl/visualization/pcl_visualizer.h>using namespace std::chrono_literals;pcl::visualization::PCLVisualizer::Ptr
simpleVis(pcl::PointCloud<pcl::PointXYZ>::ConstPtr cloud)
{// --------------------------------------------// -----Open 3D viewer and add point cloud-----// --------------------------------------------pcl::visualization::PCLVisualizer::Ptr viewer(new pcl::visualization::PCLVisualizer("3D Viewer"));viewer->setBackgroundColor(0, 0, 0);viewer->addPointCloud<pcl::PointXYZ>(cloud, "sample cloud");viewer->setPointCloudRenderingProperties(pcl::visualization::PCL_VISUALIZER_POINT_SIZE, 3, "sample cloud");//viewer->addCoordinateSystem (1.0, "global");viewer->initCameraParameters();return (viewer);
}int
main(int argc, char** argv)
{// initialize PointCloudspcl::PointCloud<pcl::PointXYZ>::Ptr cloud(new pcl::PointCloud<pcl::PointXYZ>);pcl::PointCloud<pcl::PointXYZ>::Ptr final(new pcl::PointCloud<pcl::PointXYZ>);// populate our PointCloud with pointscloud->width = 500;cloud->height = 1;cloud->is_dense = false;cloud->points.resize(cloud->width * cloud->height);for (pcl::index_t i = 0; i < static_cast<pcl::index_t>(cloud->size()); ++i){if (pcl::console::find_argument(argc, argv, "-s") >= 0 || pcl::console::find_argument(argc, argv, "-sf") >= 0){(*cloud)[i].x = 1024 * rand() / (RAND_MAX + 1.0);(*cloud)[i].y = 1024 * rand() / (RAND_MAX + 1.0);if (i % 5 == 0)(*cloud)[i].z = 1024 * rand() / (RAND_MAX + 1.0);else if (i % 2 == 0)(*cloud)[i].z = sqrt(1 - ((*cloud)[i].x * (*cloud)[i].x)- ((*cloud)[i].y * (*cloud)[i].y));else(*cloud)[i].z = -sqrt(1 - ((*cloud)[i].x * (*cloud)[i].x)- ((*cloud)[i].y * (*cloud)[i].y));}else{(*cloud)[i].x = 1024 * rand() / (RAND_MAX + 1.0);(*cloud)[i].y = 1024 * rand() / (RAND_MAX + 1.0);if (i % 2 == 0)(*cloud)[i].z = 1024 * rand() / (RAND_MAX + 1.0);else(*cloud)[i].z = -1 * ((*cloud)[i].x + (*cloud)[i].y);}}std::vector<int> inliers;// created RandomSampleConsensus object and compute the appropriated modelpcl::SampleConsensusModelSphere<pcl::PointXYZ>::Ptrmodel_s(new pcl::SampleConsensusModelSphere<pcl::PointXYZ>(cloud));pcl::SampleConsensusModelPlane<pcl::PointXYZ>::Ptrmodel_p(new pcl::SampleConsensusModelPlane<pcl::PointXYZ>(cloud));if (pcl::console::find_argument(argc, argv, "-f") >= 0){pcl::RandomSampleConsensus<pcl::PointXYZ> ransac(model_p);ransac.setDistanceThreshold(.01);ransac.computeModel();ransac.getInliers(inliers);}else if (pcl::console::find_argument(argc, argv, "-sf") >= 0){pcl::RandomSampleConsensus<pcl::PointXYZ> ransac(model_s);ransac.setDistanceThreshold(.01);ransac.computeModel();ransac.getInliers(inliers);}// copies all inliers of the model computed to another PointCloudpcl::copyPointCloud(*cloud, inliers, *final);// creates the visualization object and adds either our original cloud or all of the inliers// depending on the command line arguments specified.pcl::visualization::PCLVisualizer::Ptr viewer;if (pcl::console::find_argument(argc, argv, "-f") >= 0 || pcl::console::find_argument(argc, argv, "-sf") >= 0)viewer = simpleVis(final);elseviewer = simpleVis(cloud);while (!viewer->wasStopped()){viewer->spinOnce(100);std::this_thread::sleep_for(100ms);}return 0;
}

执行结果:

另:执行可能出现的代码错误解决方法

有两种解决方法:

1、直接跳转到该位置注释;

2、或在预编译器添加 _CRT_SECURE_NO_DEPRECATE

注:部分地方参考:

PCL学习笔记(一)-- Windows下配置安装PCL开发环境_pcl环境配置_看到我请叫我学C++的博客-CSDN博客

http://www.yayakq.cn/news/71388/

相关文章:

  • 设计网站专业wordpress 阿里云cdn
  • 白家乐网站怎么建站小程序免费推广平台
  • 怎样做网站认证山东网站建设制作公司
  • 企业网站推广策划wordpress大前端主题免费试用
  • 天津网站建设方案策划wordpress列表页怎么加关键词
  • 北京专业建设网站公司哪家好中山网站建设文化机构
  • 遵义市网站建设本科毕设做网站多少钱
  • 建个网站需要多少钱圣宝电动车大架号在哪里c2c电子商务平台有哪些
  • 成都网站排名 生客seo做网站需要掌握的软件
  • wordpress多站点注册页开发应用程序的步骤
  • 网站建设完成汇报百度刷排名seo
  • 吴忠公司做网站增强wordpress编辑器
  • 网站开发的就业前景制作手机app软件要多少钱
  • seo建站是什么龙泉市建设局门户网站
  • python 爬虫 做网站企业网络组建方案
  • 网站建设广告有哪些平台济南软件开发培训机构
  • 网站没被收录什么原因湖南企业app
  • 国外 图片网站百度网站申诉
  • 沈阳网站建设模块维护手机百度官网
  • 注册公司在哪个网站系统网站建设哪家好 需要多少钱
  • 网站开发接入本地天地图深圳专业软件网站建设
  • 深圳网站有哪些网站空间多久续一次费
  • dede 网站打开慢可以做3d电影网站有哪些
  • 个人网站如何获得流量营销型网站网站
  • 虚拟主机销售网站技术支持:淄博网站建设
  • 住房住房和城乡建设部网站wordpress 地址栏
  • 盲盒怎么制作教程seo标签怎么优化
  • 新手做网站推荐wordpress长微博工具
  • 做空比特币的网站怎么优化网站源码关键词
  • 中山市网站制作中国建设网建筑通