PCL 基于多项式拟合的法线估计、点云平滑和数据重采样

在使用Window VS2010为开发平台,学习PCL点云库的时候,学到曲面重建(Surface)。在测试下面的程序的时候,遇到了问题。

#include <pcl/point_types.h>
#include <pcl/io/pcd_io.h>
#include <pcl/io/io.h>
#include <pcl/io/ply_io.h>
#include <pcl/kdtree/kdtree_flann.h>
#include <pcl/surface/mls.h>
#include <iostream>
#include <pcl/visualization/cloud_viewer.h> #include <pcl/console/print.h>
#include <pcl/console/parse.h>
#include <pcl/console/time.h> using namespace std;
using namespace pcl;
using namespace pcl::io;
using namespace pcl::console;
int
main (int argc, char** argv)
{
cout << "Project Begin: " << endl;
// Load input file into a PointCloud<T> with an appropriate type
pcl::PointCloud<pcl::PointXYZRGBA>::Ptr cloud (new pcl::PointCloud<pcl::PointXYZRGBA> ());
// Load bun0.pcd -- should be available with the PCL archive in test
pcl::io::loadPCDFile ("pcl_point_cloud/phase2d_1.pcd", *cloud); cout << "Read .pcd File Final. " << endl;
cout << "This cloud Points number is :" << cloud->points.size() << endl; // Create a KD-Tree
pcl::search::KdTree<pcl::PointXYZRGBA>::Ptr tree (new pcl::search::KdTree<pcl::PointXYZRGBA>); // Output has the PointNormal type in order to store the normals calculated by MLS
pcl::PointCloud<pcl::PointXYZRGBNormal> mls_points; // Init object (second point type is for the normals, even if unused)
pcl::MovingLeastSquares<pcl::PointXYZRGBA, pcl::PointXYZRGBNormal> mls; mls.setComputeNormals (true); //Set parameters
mls.setInputCloud(cloud);
mls.setPolynomialFit(true);
mls.setSearchMethod(tree);
mls.setSearchRadius(.1); TicToc tt;
tt.tic (); print_highlight ("Processing ");
// Reconstruct
mls.process(mls_points);
print_info ("[done, "); print_value ("%g", tt.toc ()); print_info (" ms]\n"); cout << "Smoothing Processing cloud Points Final." << endl; std::cout << "After MLS , point cloud size is " << mls_points.size() << std::endl; // Save output
pcl::io::savePCDFile ("phase2d-mls.pcd", mls_points); cout << "Save .PCD file Final !" << endl;
cout << "New The New Cloud Points number is : " << mls_points.points.size() << endl; getchar();
return 0;
}

VS2010编译这段程序的时候,出现了下面的链接错误:

1>Smoothing_Cloud.obj : error LNK2019: 无法解析的外部符号 "public: virtual void __thiscall pcl::MovingLeastSquares<struct pcl::PointXYZRGBA,struct pcl::PointXYZRGBNormal>::process(class pcl::PointCloud<struct pcl::PointXYZRGBNormal> &)" (?process@?$MovingLeastSquares@UPointXYZRGBA@pcl@@UPointXYZRGBNormal@2@@pcl@@UAEXAAV?$PointCloud@UPointXYZRGBNormal@pcl@@@2@@Z),该符号在函数 _main 中被引用
1>Smoothing_Cloud.obj : error LNK2001: 无法解析的外部符号 "private: virtual void __thiscall pcl::MovingLeastSquares<struct pcl::PointXYZRGBA,struct pcl::PointXYZRGBNormal>::performProcessing(class pcl::PointCloud<struct pcl::PointXYZRGBNormal> &)" (?performProcessing@?$MovingLeastSquares@UPointXYZRGBA@pcl@@UPointXYZRGBNormal@2@@pcl@@EAEXAAV?$PointCloud@UPointXYZRGBNormal@pcl@@@2@@Z)
1> fatal error LNK1120: 2 个无法解析的外部命令
1>
1>生成失败。

解决办法:

添加下面这个头文件:

#include <pcl/surface/impl/mls.hpp>

再次编译,问题解决。


参考网站:

http://docs.ros.org/hydro/api/pcl/html/mls_8hpp.html

http://d.hatena.ne.jp/takmin/comment?date=20130719

解决PCL MLS : error LNK2019; error LNK2001 virtual MovingLeastSquares process performProcessing问题的更多相关文章

  1. error LNK2019: 无法解析的外部符号 __imp___CrtDbgReportW

    error LNK2005 and error LNK2019 error LNK2019: unresolved external symbol __imp___CrtDbgReportW refe ...

  2. error LNK2019: 无法解析的外部符号(编程解决方法)

    正在编译...1>Ipv4IPv6traceroutesrc.cpp1>d:\研究生\c++\study\test\test\ipv4ipv6traceroutesrc.cpp(461) ...

  3. 错误 1 error LNK2019: 无法解析的外部符号 __imp__pthread_create,该符号在函数 _main 中被引用 解决方法

    晚上花几分钟在windows下测了下pthread的用法,出现错误 1 error LNK2019: 无法解析的外部符号 __imp__pthread_create,该符号在函数 _main 中被引用 ...

  4. (obj) error: LNK2019: 无法解析的外部符号解决方法

    利用VS2010 C++ 调用 labview生成的动态库编程时无法生成exe 报错信息: Cjj_32.obj : error LNK2019: 无法解析的外部符号 _GetPXIResource@ ...

  5. 链接报error LNK2019: unresolved external symbol错误,解决

    http://blog.163.com/aiding_001/blog/static/22908192011102224344450/ 某次编写一个COM组件,接口定义好之后,增加了ZRX代码后编译链 ...

  6. “error LNK2019: 无法解析的外部符号”之分析

    最近在用VS 2008开发,初学遇到不少问题,最头疼的问题之一就是:LNK2019. 百度一下讲的并不够全面,反正都没解决我的问题. error LNK2019问题在VC 6.0中是error LNK ...

  7. error LNK2019: 无法解析的外部符号 _WinMain@16,该符号在函数 ___tmainCRTStartup 中被引用

    MSVCRTD.lib(crtexew.obj) : error LNK2019: 无法解析的外部符号 _WinMain@16,该符号在函数 ___tmainCRTStartup 中被引用 Debug ...

  8. MSVCRTD.lib(mfc.obj) : error LNK2019: 无法解析的外部符号 _WinMain@16,该符号在函数 ___tmainC (转)

    一.问题描述 我所使用的编程环境:VS2010 出现的问题如下: MSVCRTD.lib(mfc.obj) : error LNK2019: 无法解析的外部符号_WinMain@16,该符号在函数 _ ...

  9. error LNK2019: 无法解析的外部符号 _WinMain@16,该符号在函数 ___tmainCR...

    http://blog.csdn.net/playstudy/article/details/6661868 一,问题描述MSVCRTD.lib(crtexew.obj) : error LNK201 ...

随机推荐

  1. P4455 [CQOI2018]社交网络(矩阵树定理)

    题目 P4455 [CQOI2018]社交网络 \(CQOI\)的题都这么裸的吗?? 做法 有向图,指向叶子方向 \(D^{out}(G)-A(G)\) 至于证明嘛,反正也就四个定理,先挖个坑,省选后 ...

  2. hd acm1005

    问题: 已知递推公式:f[i] = ( a * f[i-1] + b * f[i-2] ) % 7,f[1]=1,f[2]=1. 需要你输入三个数a,b,n.其中a,b用来补充上述公式,用补充后的公式 ...

  3. expr命令使用

    转载:http://www.cnblogs.com/f-ck-need-u/p/7231832.html expr命令可以实现数值运算.数值或字符串比较.字符串匹配.字符串提取.字符串长度计算等功能. ...

  4. EntityFramework 学习 一 实体类型

    我们为已存在的数据库创建EDM,EDM包含与数据库中表对应的实体.EF中有两种实体类型 POCO entity dynamic proxy entity POCO Entity (Plain Old ...

  5. Spark集群搭建(local、standalone、yarn)

    Spark集群搭建 local本地模式 下载安装包解压即可使用,测试(2.2版本)./bin/spark-submit --class org.apache.spark.examples.SparkP ...

  6. JavaWeb -- Session应用实例 -- 随机中文验证码 检验

    注册页面 login.html <?xml version="1.0" encoding="UTF-8" ?> <!DOCTYPE html ...

  7. Oracle视图的使用

    --视图的语法 create [ or replace ] [NO Force | Force] View schema.view_name--视图名称 [(alias,...)inline_cons ...

  8. sqlserver 实现数据库全文检索

    --在执行该脚本程序之前启动sql server的全文搜索服务,即microsoft search服务 use huarui_db --打开数据库 go --检查huarui_db是否支持全文索引,如 ...

  9. Geoserver端口冲突解决方案(二)

    转载:https://blog.csdn.net/sx341125/article/details/52091903 上一篇文章说了GeoServer的安装问题,其中一个问题就是GeoServer端口 ...

  10. Jmete基础使用

    1,jmeter下载与安装 Jmeter的运行需要JDK支持,所以需要先安装好jdk,并配置好环境变量: 下载地址:http://jmeter.apache.org/download_jmeter.c ...