APAP多图拼接代码
整理一下APAP image stitching的代码:
项目地址:https://cs.adelaide.edu.au/~tjchin/apap/
其中MDLT是两张图片的拼接,调试过程基本很简单,不再赘述;
对于BAMDLT多图拼接代码,现将出现的问题及解决办法整理如下:
- 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;# CMake sudo apt-get install cmake # google-glog + gflags sudo apt-get install libgoogle-glog-dev # BLAS & LAPACK sudo apt-get install libatlas-base-dev # Eigen3 sudo 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-1319687 sudo apt-get update sudo apt-get install libsuitesparse-dev # 依赖项安装完成,安装Ceres tar zxf ceres-solver-1.3.0.tar.gz mkdir ceres-bin cd ceres-bin cmake ../ceres-solver-1.3.0 make -j3 make 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版本步骤如下:
#安装gcc sudo add-apt-repository ppa:ubuntu-toolchain-r/test sudo apt-get update sudo apt-get install gcc-4.7 sudo apt-get install g++-4.7 #查看g++安装路径 which gcc #先切换到g++安装路径下 cd /usr/bin/ //我电脑中g++安装路径 #在该路径下将gcc链接到gcc-4.7 sudo 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
APAP多图拼接代码相关推荐
- APAP多图拼接代码配置运行总结
感谢这位博主的博客,他已经很详细的说明了该如何运行这个代码https://blog.csdn.net/dreamguard/article/details/84898505 这里有一些补充和说明 1. ...
- python多图拼接并利用resnet提取特征
代码功能: 1.将多张图拼接成一张大图: 2.基于resnet提取大图的特征. import torch import torch.nn as nn from torchvision import m ...
- 【HigherHRNet】 HigherHRNet 详解之 HigherHRNet的热图回归代码
相关系列链接: 前言: HigherHRNet 来自于CVPR2020的论文: HigherHRNet: Scale-Aware Representation Learning for Bottom- ...
- opencv Stitcher多图拼接
Opencv使用Stitcher类图像拼接生成全景图像 Opencv中自带的Stitcher类可以实现全景图像,效果不错.下边的例子是Opencv Samples中的stitching.cpp的简化, ...
- [css] 自定义背景图拼接
将背景切片为head.body.foot三个png /*背景图片*/background: url(~@/assets/head.png) no-repeat centertop/100% 73px, ...
- 心形图Python代码详细解析
心形图Python代码详细解析 源代码 print('\n'.join([''.join([('pikachu'[(x-y)%7]\if((x*0.05)**2+(y*0.1)**2-1)**3-(x ...
- 最全Pycharm教程(43)——Pycharm扩展功能之UML类图使用 代码结构
版权声明:本文为博主原创文章,转载时麻烦注明源文章链接,谢谢合作 https://blog.csdn.net/u013088062/article/details/50353202 1.什么是UML ...
- 【设计模式】装饰器模式类图和代码
文章目录 1 概述 2 类图 3 代码 1 概述 2 类图 3 代码 package lixiang;public class Test {public static void main(String ...
- python导入txt文件并绘图-Python实现读取txt文件并画三维图简单代码示例
记忆力差的孩子得勤做笔记! 刚接触python,最近又需要画一个三维图,然后就找了一大堆资料,看的人头昏脑胀的,今天终于解决了!好了,废话不多说,直接上代码! #由三个一维坐标画三维散点 #codin ...
最新文章
- NLP命名实体识别NER数据准备及模型训练实例
- Microsoft 用户体验虚拟化 UE-V 1.0 RC 发布
- Spring 事物传播特性
- linux shell中各种分号和括号,linux shell 各种分号,括号使用方法总结
- Django:保持会话状态cookies和session(1)
- 2. Browser 对象 - Window 对象(2)
- 写给大家看的设计模式
- 图书馆管理系统的c语言,图书馆管理系统 c语言.doc
- Java项目:SSM的校园二手交易平台
- 华硕飞行堡垒加装固态硬盘和内存条
- 下载堆糖图片-正则-xpath-BeautifulSoup-selenium-python爬虫
- Linux 常用命令大全
- 银联权益信息API接口及管理平台解决方案相关介绍
- 2021厦大计算机考研炸了,【图片】一战厦大计算机上岸,经验帖。慢更【考研吧】_百度贴吧...
- 面向对象:感受温柔,领略山河,遇见不容易,喜欢望珍惜
- CSV文件编辑器——Modern CSV for mac
- 电子实验室仪器使用大全
- 算法学习:归并排序, pta归并排序(递归法)
- androidStudio分包引起的系统崩溃,报错ClassNotFoundException: Didn‘t find class “XXXView“ on path: DexPath../.apk
- 【Hexo】Hexo-NexT主题-博客搭建