apap图像拼接_20张以上多图拼图软件

大家好,又见面了,我是你们的朋友全栈君。

整理一下APAP image stitching的代码:

项目地址:https://cs.adelaide.edu.au/~tjchin/apap/
其中MDLT是两张图片的拼接,调试过程基本很简单,不再赘述;
对于BAMDLT多图拼接代码,现将出现的问题及解决办法整理如下:

  1. BAMDLT使用依赖三个库,分别是EIGEN, Google’s Ceres solver,GLOG

其中EIGEN库的安装按照官方教程 http://eigen.tuxfamily.org/index.php?title=Main_Page
即可,也不存在由于版本导致的问题;

GLOG如果安装的是最新版本,会发现根本没有libglog.so库(该库在matlab函数用mex编译时需要),只有libglog.a库,因此它需要安装old version,old version链接为 https://github.com/google/glog/releases
0.3.4以前的版本应该都可以,我安装的是glog:0.3.4,安装代码为:

tar zxvf glog-0.3.4.tar.gz
cd glog-0.3.4
./configure
make
sudo make install

安装完成后可以在目录/usr/local/lib下看到liblog.so动态库

同样的,Google’s Ceres solver也不能安装最新版本,否则就找不到libcere_shared.so动态库,也需要安装old version,链接为 https://ceres-solver.googlesource.com/ceres-solver/+refs
APAP中使用的是1.6.0版本,但在我电脑上该版本无法编译,因此我安装了1.3.0版本,然后重新编译生成了mex文件
安装过程中首先需要安装依赖项,其次安装Ceres;

# CMakesudo apt-get install cmake# google-glog + gflagssudo apt-get install libgoogle-glog-dev# BLAS & LAPACKsudo apt-get install libatlas-base-dev# Eigen3sudo apt-get install libeigen3-dev# SuiteSparse and CXSparse (optional)# - If you want to build Ceres as a *static* library (the default)# you can use the SuiteSparse package in the main Ubuntu package# repository:sudo apt-get install libsuitesparse-dev# - However, if you want to build Ceres as a *shared* library, you must# add the following PPA:sudo add-apt-repository ppa:bzindovic/suitesparse-bugfix-1319687sudo apt-get updatesudo apt-get install libsuitesparse-dev# 依赖项安装完成,安装Cerestar zxf ceres-solver-1.3.0.tar.gzmkdir ceres-bincd ceres-bincmake ../ceres-solver-1.3.0make -j3make test# Optionally install Ceres, it can also be exported using CMake which# allows Ceres to be used without requiring installation, see the documentation# for the EXPORT_BUILD_DIR option for more information.make install

安装完成后可以在/usr/local/lib下发现libceres_shared.so文件等

代码依赖项安装完毕,接下来是代码,由于我使用的是matlab2015b,对于该版本及以上its pooling function改变了,因此需要将

将该部分:poolsize = matlabpool('size');if poolsize == 0 %if not, we attemp to do it:    matlabpool open;end修改为:if isempty(gcp('nocreate'))   parpool;end

前面我说过,我安装Google Ceres Solver版本是1.3.0, 因此需要重新生成ceresRigidError.mexa64和ceresNonrigidError.mexa64文件,运行MDLT_mainImageStitchingNRBA.m,这个时候注意如果出现了这样的警告: Warning: You are using gcc version ‘4.8.4’. The version currently supported with MEX is ‘4.7.x’. 不要忽略,不要忽略,不要忽略 (以前养成的陋习,warning都不管)。这是因为高版本ubuntu系统自带的gcc版本过高,这时候需要将系统gcc版本更换为4.7,如果不更换,即使matlab编译成功,也可能会在调用.mexa64文件报错找不到libceres_shared.so.1.3.0更换gcc版本步骤如下:

#安装gccsudo add-apt-repository ppa:ubuntu-toolchain-r/testsudo  apt-get updatesudo apt-get  install gcc-4.7sudo apt-get  install g++-4.7#查看g++安装路径which gcc #先切换到g++安装路径下cd /usr/bin/ //我电脑中g++安装路径#在该路径下将gcc链接到gcc-4.7sudo rm g++  //删除原来的符号链接sudo ln -s g++-4.7 g++ //重新创建链接g++ -v //可见版本已经为4.7了 

重新运行MDLT_mainImageStitchingNRBA.m,如果此时报错…/glnxa64/libstdc++.so.6: version `GLIBCXX_3.4.21’ not found,可以在bash中运行下面命令,然后重启matlab

ln -sf /usr/lib/x86_64-linux-gnu/libstdc++.so.6 /usr/local/MATLAB/R2015b/sys/os/glnxa64/libstdc++.so.6 	

到这基本大功告成,另外可以给一个建议就是运行matlab时候建议在sudo权限下

参考链接:
https://cs.adelaide.edu.au/~tjchin/apap/#Source
http://ceres-solver.org/installation.html
http://eigen.tuxfamily.org/index.php?title=Main_Page
https://blog.csdn.net/u012702874/article/details/50658441
https://blog.csdn.net/Hansry/article/details/80325296
https://www.jianshu.com/p/b7bd7e3044bc

版权声明:本文内容由互联网用户自发贡献,该文观点仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 举报,一经查实,本站将立刻删除。

发布者:全栈程序员栈长,转载请注明出处:https://javaforall.cn/190504.html原文链接:https://javaforall.cn

未经允许不得转载:木盒主机 » apap图像拼接_20张以上多图拼图软件

赞 (0)

相关推荐

    暂无内容!