Windows7系统下OpenCV2.4.4+PCL1.6.0+SSBA3.0+VS2010 IDE32环境下编译和安装以实现Sfm和PCL点云数据可视化
最近在学习《深入理解OpenCV:实用计算机视觉项目解析》一书的第三章和第四章时,遇到很多编译问题,书中又没有详细的讲解环境配置和搭建过程。经过多天的捉摸、调试、排错终于将两章的程序都调试成功了,先做个记录以备忘。该书的英文名为:《Mastering OpenCV with Practical Computer Vision Projects》。
一、开发环境概述
1、OpenCV版本:2.4.4;
2、PCL版本:1.6.0;
3、SSBA版本:3.0;
4、IDE版本:VS2010 32位,字符集:使用多字节字符集;
5、PCL如果涉及到OpenGL,则采用OpenGL32.lib和OpenGL.dll。
二、OpenCV2.4.4编译和安装
1、OpenCV2.4.4下载地址:https://github.com/opencv/opencv/releases?after=2.4.6.1,如下图所示:

2、具体的编译和配置工作参考:OpenCV2.4.12 开启OpenGL启用三维可视化支持。
注意:(1)第一次点击“Configure”时,请在“Specify the generator for this project”选择“Visual Studio 10”,该选项是32位的;
(2)如果你的计算机上已经安装了英伟达GPU CUDA驱动程序,则CMake会检测出来并默认勾选上“WITH_CUDA”。一般情况下,大家的计算机的GPU卡的计算能力CC不够高,为了避免后续编译时出现的各种错误,此去请不要勾选上“WITH_CUDA”。除非你的显卡支持能够支持高级的CUDA计算能力,才能够编译通过。
(3)OpenCV默认情况下是不支持OpenGL的,如果要使OpenCV支持OpenGL,则需要重编译。则需要勾选上“WITH_OPENGL”。如下图所示:

3、常见编译问题汇总:
- OPENCV3.3+CUDA9.0 环境搭建若干错误总结
- VS2010自行编译OpenCV2.4.4时缺少python27_d.lib的解决方法
- VS2015+OpenCV3.3 GPU模块和opencv_contrib模块的编译以及采用CMake编译opencv_contrib时提示“No extra modules found in folder”问题的解决方案
三、PCL1.6.0编译和安装
PCL1.6.0下载、编译和安装请参考文档:VS2010中配置PCL
四、SSBA3.0编译和安装
SSBA3.0下载、编译和安装请参考博文:VS2013+简单稀疏光束调整库SSBA配置(64位编译)
注意:该项目编译出来的colamd.lib和V3D.lib都是静态库,没有*.dll后缀的文件。因为colamd和V3D两个项目的配置类型都是“静态库(.lib)”。如下图所示:

五:其它注意事项
1、所有的所依赖的第三方开源框架库都配置好后,如果还需要OpenGL库的话,需要给工程文件添加OpenGL32.lib的静态到入库(项目属性-连接器-输入-附加依赖项)和OpenGL.dll动态链接库。
2、在编译的过程中可能会提示“vtk***无法解决的外部符号”,如下所示:
>vtkSDIDoc.obj : error LNK2019: 无法解析的外部符号 "__declspec(dllimport) public: thiscall vtkSmartPointerBase::vtkSmartPointerBase(void)" (imp_??0vtkSmartPointerBase@@QAE@XZ),该符号在函数 "public: thiscall vtkSmartPointer::vtkSmartPointer(void)" (???$vtkSmartPointer@VvtkImageData@@@@QAE@XZ) 中被引用
>vtkSDIView.obj : error LNK2001: 无法解析的外部符号 "declspec(dllimport) public: thiscall vtkSmartPointerBase::vtkSmartPointerBase(void)" (imp_??0vtkSmartPointerBase@@QAE@XZ)
>vtkSDIDoc.obj : error LNK2019: 无法解析的外部符号 "__declspec(dllimport) public: thiscall vtkSmartPointerBase::~vtkSmartPointerBase(void)" (imp_??1vtkSmartPointerBase@@QAE@XZ),该符号在函数 "public: thiscall vtkSmartPointer::~vtkSmartPointer(void)" (???$vtkSmartPointer@VvtkImageData@@@@QAE@XZ) 中被引用
>vtkSDIView.obj : error LNK2001: 无法解析的外部符号 "declspec(dllimport) public: thiscall vtkSmartPointerBase::~vtkSmartPointerBase(void)" (imp_??1vtkSmartPointerBase@@QAE@XZ)
>vtkSDIDoc.obj : error LNK2019: 无法解析的外部符号 "__declspec(dllimport) public: class vtkSmartPointerBase & thiscall vtkSmartPointerBase::operator=(class vtkObjectBase *)" (imp_??4vtkSmartPointerBase@@QAEAAV0@PAVvtkObjectBase@@@Z),该符号在函数 "public: class vtkSmartPointer & thiscall vtkSmartPointer::operator=(class vtkImageData *)" (???$vtkSmartPointer@VvtkImageData@@@@QAEAAV0@PAVvtkImageData@@@Z) 中被引用
>vtkSDIDoc.obj : error LNK2019: 无法解析的外部符号 "declspec(dllimport) public: class vtkSmartPointerBase & thiscall vtkSmartPointerBase::operator=(class vtkSmartPointerBase const &)" (imp_??4vtkSmartPointerBase@@QAEAAV0@ABV0@@Z),该符号在函数 "public: class vtkSmartPointer & thiscall vtkSmartPointer::operator=(class vtkSmartPointer const &)" (???$vtkSmartPointer@VvtkImageData@@@@QAEAAV0@ABV0@@Z) 中被引用
>vtkSDIView.obj : error LNK2001: 无法解析的外部符号 "declspec(dllimport) public: class vtkSmartPointerBase & thiscall vtkSmartPointerBase::operator=(class vtkSmartPointerBase const &)" (imp_??4vtkSmartPointerBase@@QAEAAV0@ABV0@@Z)
>vtkSDIDoc.obj : error LNK2019: 无法解析的外部符号 "__declspec(dllimport) protected: thiscall vtkSmartPointerBase::vtkSmartPointerBase(class vtkObjectBase *,class vtkSmartPointerBase::NoReference const &)" (imp_??0vtkSmartPointerBase@@IAE@PAVvtkObjectBase@@ABVNoReference@@@Z),该符号在函数 "protected: thiscall vtkSmartPointer::vtkSmartPointer(class vtkImageData *,class vtkSmartPointerBase::NoReference const &)" (???$vtkSmartPointer@VvtkImageData@@@@IAE@PAVvtkImageData@@ABVNoReference@vtkSmartPointerBase@@@Z) 中被引用
>vtkSDIView.obj : error LNK2001: 无法解析的外部符号 "declspec(dllimport) protected: thiscall vtkSmartPointerBase::vtkSmartPointerBase(class vtkObjectBase *,class vtkSmartPointerBase::NoReference const &)" (imp_??0vtkSmartPointerBase@@IAE@PAVvtkObjectBase@@ABVNoReference@@@Z)
>vtkSDIDoc.obj : error LNK2019: 无法解析的外部符号 "__declspec(dllimport) public: static class vtkImageData * cdecl vtkImageData::New(void)" (imp_?New@vtkImageData@@SAPAV1@XZ),该符号在函数 "public: static class vtkSmartPointercdecl vtkSmartPointer::New(void)" (?New@?$vtkSmartPointer@VvtkImageData@@@@SA?AV1@XZ) 中被引用
>vtkSDIDoc.obj : error LNK2019: 无法解析的外部符号 "declspec(dllimport) public: class vtkImageData * thiscall vtkImageAlgorithm::GetOutput(void)" (imp_?GetOutput@vtkImageAlgorithm@@QAEPAVvtkImageData@@XZ),该符号在函数 "public: void thiscall CvtkSDIDoc::OnFileOpen(void)" (?OnFileOpen@CvtkSDIDoc@@QAEXXZ) 中被引用
>vtkSDIDoc.obj : error LNK2019: 无法解析的外部符号 "declspec(dllimport) public: static class vtkJPEGReader * cdecl vtkJPEGReader::New(void)" (imp_?New@vtkJPEGReader@@SAPAV1@XZ),该符号在函数 "public: static class vtkSmartPointercdecl vtkSmartPointer::New(void)" (?New@?$vtkSmartPointer@VvtkJPEGReader@@@@SA?AV1@XZ) 中被引用
>vtkSDIView.obj : error LNK2019: 无法解析的外部符号 "declspec(dllimport) public: static class vtkImageViewer2 * cdecl vtkImageViewer2::New(void)" (imp_?New@vtkImageViewer2@@SAPAV1@XZ),该符号在函数 "public: static class vtkSmartPointercdecl vtkSmartPointer::New(void)" (?New@?$vtkSmartPointer@VvtkImageViewer2@@@@SA?AV1@XZ) 中被引用
>vtkSDIView.obj : error LNK2019: 无法解析的外部符号 "declspec(dllimport) public: static class vtkRenderWindowInteractor * cdecl vtkRenderWindowInteractor::New(void)" (imp_?New@vtkRenderWindowInteractor@@SAPAV1@XZ),该符号在函数 "public: static class vtkSmartPointer __cdecl vtkSmartPointer::New(void)" (?New@?$vtkSmartPointer@VvtkRenderWindowInteractor@@@@SA?AV1@XZ) 中被引用
首先说明,VTK是PCL所依赖的第三方库开源的可视化工具库。此时,需要把C:\Program Files (x86)\PCL 1.6.0\3rdParty\VTK\lib\vtk-5.8目录下的vtk开头的相关*.lib文件通过“项目属性-连接器-输入-附加依赖项”方式添加到工程,但是这样太麻烦,可在“解决方案资源管理器”中的“资源文件”上单击右键-添加-现有项,从而将所有vtk开头的相关*.lib文件添加到工程中。如下图所示:

3、fatal error C1083: 无法打开包括文件:“vtkCommand.h”: No such file or direct:可在系统环境变量PATH中将VTK的包含目录再增加一层:$(PCL_ROOT)\3rdParty\VTK\include\vtk-5.8。其中PCL_ROOT为PCL安装时设置的系统环境变量,其值为:C:\Program Files (x86)\PCL 1.6.0。
4、OpenCV和PCL同时引用了Flann 引起冲突:Opencv+PCL=Flann 冲突?
5、安装CMake和PCL-1.6.0-AllInOne-msvc2010-win32.exe打算使安装程序自行将路径添加到系统的环境变量PATH时,会弹出失败提示:path too long installer unable to modify path 导致PCL配置失败记。此时可手工将相关路径添加到系统的环境变量PATH中。path too long installer unable to modify path 导致PCL配置失败记。
6、std::max、std::min error C2589: “(”:“::”右边的非法标记,error C2059: 语法错误:“::”
参考链接:
1、OpenCV2.4.13+CUDA8.0+SSBA3.0+VS2010编译安装
2、WIN7(32位)VS2010+openCV 2.4.10+PCL 1.6.0+CUDA 6.5.14+CMake 3.2.1+SSBA-3.0配置
Windows7系统下OpenCV2.4.4+PCL1.6.0+SSBA3.0+VS2010 IDE32环境下编译和安装以实现Sfm和PCL点云数据可视化的更多相关文章
- VS2010 C++环境下DLL和LIB文件目录及名称修改
VS2010 C++环境下DLL和LIB文件目录及名称修改 转自:http://blog.csdn.net/archielau/article/details/8507581 DLL工程,Debug版 ...
- 水晶报表在vs2010 WPF环境下的尝试
原文:水晶报表在vs2010 WPF环境下的尝试 由于VS2010没有集成水晶报表组件,尝试前必须先安装 水晶报表 for VS2010,若机器未安装的可点击这里>>>下载安装 新建 ...
- 【原创】Linux环境下的图形系统和AMD R600显卡编程(1)——Linux环境下的图形系统简介
Linux/Unix环境下最早的图形系统是Xorg图形系统,Xorg图形系统通过扩展的方式以适应显卡和桌面图形发展的需要,然而随着软硬件的发展,特别是嵌入式系统的发展,Xorg显得庞大而落后.开源社区 ...
- Linux环境下的图形系统和AMD R600显卡编程(1)——Linux环境下的图形系统简介
转:https://www.cnblogs.com/shoemaker/p/linux_graphics01.html Linux/Unix环境下最早的图形系统是Xorg图形系统,Xorg图形系统通过 ...
- win8.1 vs2010 C++环境下 编译Android Adb.exe
1 IntelliSense: cannot open source file "usb100.h" adb 这是因为没有安装sdk造成的.win7下安装wdk,vs2010能够 ...
- VS2010 C++环境下DLL和LIB文件的生成与调试
利用VS2010工具,调试DLL文件的方法现总结如下: 在一个解决方案中生成两个工程,假设MYDLL和MYDLG两个工程,前者是DLL工程,后者DLG调用前边的DLL工程.设置如下: 目录如下:图,本 ...
- VS2010 C++环境下DLL和LIB文件的生成与调试 备忘
利用VS2010工具,调试DLL文件的方法现总结如下: 在一个解决方案中生成两个工程,假设MYDLL和MYDLG两个工程,前者是DLL工程,后者DLG调用前边的DLL工程.设置如下: 目录如下:图,本 ...
- 【转】Oracle RAC 环境下的连接管理
文章转自:http://www.oracle.com/technetwork/cn/articles/database-performance/oracle-rac-connection-mgmt-1 ...
- Redis学习——Linux环境下Redis的安装(一)
一.关于Redis Redis最为一款开源的key-value存储系统,自推出到现在一直受到编程人员的喜爱.它支持存储多种value类型,String .List .Set .Zset .Hash.这 ...
随机推荐
- Beans Game(博弈 | | DP)zoj 3057
Beans Game Time Limit: 5 Seconds Memory Limit: 32768 KB There are three piles of beans. TT and DD pi ...
- 100行代码实现现代版Router
原文:http://www.html-js.com/article/JavaScript-version-100-lines-of-code-to-achieve-a-modern-version ...
- Stylus基本使用
介绍 在学习一个 Vue.js 项目的过程中,注意到源码中样式的部分并没有用熟悉的 .css 样式文件,而是发现了代码长得和 CSS 相像的 .styl 文件.这个 .styl 以前没见过啊,你是谁? ...
- 前端js获取checkbox的值
1. var old = $("#old").val(); if (old != null && old != 'undefined' && old ...
- SQLServer 学习笔记之超详细基础SQL语句 Part 9
Sqlserver 学习笔记 by:授客 QQ:1033553122 -----------------------接Part 8------------------- 3 范式的概念 第一范式的目标 ...
- AutoCompleteTextView 自定义提示样式
项目中用到AutoCompleteTextView 自动提示功能,如果用自带的ArrayAdapter就一种样式,非常丑,而且每一项提示文字过多的话不会自动换行. 所以自己自定义了一个适配器. 效果 ...
- Android热修复之 - 收集崩溃信息上传服务器
1.概述 大致的流程就是在用户崩溃的时候,我们获取崩溃信息.应用当前的信息和手机信息,然后把它保存到手机内存卡,再找我就直接找出来看看.后来衍生到上线后某些奇葩机型会有部分问题,所以不得不上传到服务器 ...
- Unity Profiler连接Android真机调试
Profiler在Editor模式就可以观看性能消耗,但是毕竟电脑配置高,跟手机真机环境还是有区别.实际开发中的优化还是推荐用真机测试. 因为IOS一般比Android手机的配置高,在Android平 ...
- Pycharm代码补齐功能中的图标的意思
分清楚图标的意思就能更好的使用对应的方法.类,避免错误使用括号 PS:博主老是给属性方法加上括号 代表方法: 红色的m.f, 代表类变量: 黄色的f 之前遇到个属性方法: 好像是p,无 ...
- Oracle EBS AP 发票放弃行
-- purpose: 应付发票放弃发票行 -- 12.2.6 环境 -- author:jenrry create_date: 2017-06-07 declare l_dummy_msg VARC ...