我是靠谱客的博主 平淡汉堡,最近开发中收集的这篇文章主要介绍PTAM compile and run in windows X64 visual studio 2012 with opencv camera,觉得挺不错的,现在分享给大家,希望可以做个参考。

概述

折腾了两天PTAM,终于跑起来了。记录如下,希望可以帮到有需要的朋友。

 

Environment: windows 7 x64 visual studio 2012

 

1.PTAM

http://www.robots.ox.ac.uk/~gk/PTAM/ 
https://github.com/Oxford-PTAM/PTAM-GPL 
https://www.youtube.com/watch?v=F3s3M0mokNc 
 
guys might help
http://blog.csdn.net/cgf_909/article/details/24457771
http://blog.csdn.net/lxiaoxiaot/article/details/6209635
http://happymeme.com/?p=46
http://caocancabbage.blogspot.com/2012/09/parallel-tracking-and-mapping-ptam-in.html
https://ewokrampage.wordpress.com/troubleshooting-faq/
 
2.compile PTAM
1. first try with  https://github.com/hustcalm/PTAM-opencv since I don't have a 1394 camera and using webcam. Thanks to them, they have writed things work with opencv camera.
2. things you will need.
 
https://github.com/hustcalm/PTAM-opencv
  • GLEW
  • Lapack and BLAS
  • opencv
  • pthreads
  • libjpeg
  • fltk
these are things needed to compile LibCVD, TooN, and GVars3(they are already in the PTAM-opencv project) , download X64 version if there exist.
 
3. trying to compile libcvd
change the properties adding the header files libs path and and debug is OK!!!
release
 1> Performing Custom Build Tools
1> 系统找不到指定的文件。
1>C:Program Files (x86)MSBuildMicrosoft.Cppv4.0V110Microsoft.CppCommon.targets(172,5): error MSB6006: "cmd.exe" exited with code 1. 
 
错误指向 
Performing Custom Build Tools
1>  已复制         1 个文件。
custom build的问题,打开.vcxproj,搜
custom build,可以看到这个build在干什么,仔细对比,发现debug和release的不同。
 
check this carefully!
    <CustomBuild Include="config.h">
      <Command Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">copy ..vc2005%(Filename)%(Extension) ....cvd
</Command>
      <Command Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">copy ..vc2005%(Filename)%(Extension) ....cvd
</Command>
      <Outputs Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">....cvd%(Filename)%(Extension);%(Outputs)</Outputs>
      <Outputs Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">....cvd%(Filename)%(Extension);%(Outputs)</Outputs>
      <Command Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">copy ..vc2005%(Filename)%(Extension) ....cvd
</Command>
      <Command Condition="'$(Configuration)|$(Platform)'=='Release|x64'">copy %(Filename)%(Extension) ....cvd
</Command>
      <Outputs Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">....cvd%(Filename)%(Extension);%(Outputs)</Outputs>
      <Outputs Condition="'$(Configuration)|$(Platform)'=='Release|x64'">....cvd%(Filename)%(Extension);%(Outputs)</Outputs>
    </CustomBuild>
全部改一样,build success!!!!
 
4. trying to compile gvar3
path to prebuild.2
path to fltk2.0 (download it from web)
do it for both of the project.
 
build success!!!
 
5. trying to build PTAM
calibration
path to include files.
change to opencv camera rather than 1394, change to the file VideoSource_Linux_OpenCV.cc
adding the right .cc files, why this happenning...
link error... probably beacause of the opencv cv and other things in X86/X64
make sure all things are x64 version. X86 have pthreadVC2, VCE2, VSE2 x64 only have VC2. hopefully...
build success!!!
run missing dll. 
add dlls like:

Search MSDN for "How to: Set Environment Variables for Projects". (It's Project>Properties>Configuration Properties>Debugging "Environment" and "Merge Environment" properties for those who are in a rush.)

The syntax is NAME=VALUE and macros can be used (for example, $(OutDir)).

For example, to prepend C:WindowsTemp to the PATH:

PATH=C:WINDOWSTemp;%PATH%

Similarly, to append $(TargetDir)DLLS to the PATH:

PATH=%PATH%;$(TargetDir)DLLS

missing ....      libifcoremdd.dll
this is fortran things....
https://software.intel.com/en-us/articles/redistributable-libraries-for-the-intel-c-and-visual-fortran-composer-xe-for-windows/ down things here and add them to path.;
 
missing...          MSVCR120D.dll
 
Ultimate solutions here!!!
 
these is all because of  LAPACK & BLAS...     
 
 For this purpose we patched the LAPACK-3.5.0 source codes, compiled them using Intel ® Fortran compiler 2013 and linked with Miscrosoft Visual Studio 12: 
 
try to find dll lib dependency with depency walker
 

 
fllow these guys, and use the MT version of libs and compile
 
 
unresolved external symbol dgesvd_  
 
THIS IS ALL BECAUSE OF WRONG LIB AND DLL OF Lapack !!! REMEMBER! the lapack lib and dll should be exactly the same of the PTAM project setting, X64, compiler, MT
 
try to download the source here  http://icl.cs.utk.edu/lapack-for-windows/lapack/#lapacke and compile them!
here is a version of X64 VS2012 MT  http://ylzhao.blogspot.hk/2013/10/blas-lapack-precompiled-binaries-for.html 
work!!!
 
make sure that all of the libs/dll are compiled/downloaded in exactly the same way!!  X64 debug/release MT/MTD!!
 
6.compile PTAM
.h and .cc files are missing, add them all.
change camera things to opencvs 
solve stranage .h files included. comment out#include <unistd.h>
 
done! running!
 
 
3. calibration and run
http://wiki.ros.org/ethzasl_ptam/Tutorials/camera_calibration 
run calibration first,
copy the setting.cfg to project path where camera.cfg saved by the calibration.


ENJOY!
 

转载于:https://www.cnblogs.com/flankechen/p/PTAM-opencv-compile.html

最后

以上就是平淡汉堡为你收集整理的PTAM compile and run in windows X64 visual studio 2012 with opencv camera的全部内容,希望文章能够帮你解决PTAM compile and run in windows X64 visual studio 2012 with opencv camera所遇到的程序开发问题。

如果觉得靠谱客网站的内容还不错,欢迎将靠谱客网站推荐给程序员好友。

本图文内容来源于网友提供,作为学习参考使用,或来自网络收集整理,版权属于原作者所有。
点赞(63)

评论列表共有 0 条评论

立即
投稿
返回
顶部