必要准备
Jetson TX1 或 带有NVIDIA显卡的电脑
Ubuntu 16.0.4
CUDA 8.0
OpenCV4Tegra 2.4.13.1、OpenCV 2.4.13.6 和 OpenCV 3.4.0
Stitching模块概述
stitching是OpenCV的图像拼接模块,其示例程序分为stitching.cpp和stitching_detailed.cpp,stitching.cpp 使用最高层封装stitcher类进行拼接,stitching_detailed.cpp包含了图像拼接一般步骤的函数实现,其中特征提取时用到了surf算法,用户可以自定义一些参数以实现不同的拼接效果。stitching_detailded.cpp在编译为程序后,其输入参数包含了--try_gpu(在opencv 3.x下为--try_cuda)。使用--try_gpu yes可以使用cuda对默认采用的surf算法进行加速。
专利算法
由于surf和sift算法的专利问题,OpenCV未自带surf和sift算法。可以通过编译OpenCV时结合第三方库来实现在OpenCV下使用surf和sift算法。OpenCV 2.x和3.x有不同的安装方法。
OpenCV 2.x下nonfree模块的安装
在cmake时采用默认配置即可,在使用sift或surf算法时必须 #include <opencv2/nonfree.hpp>
如果丢失nonfree模块,网传方法
sudo apt-get update
sudo add-apt-repository --yes ppa:xqms/opencv-nonfree
sudo apt-get update
sudo apt-get insta