天天看点

opencv3图像拼接_图像拼接|——OpenCV3.4 stitching模块分析(一)前言

  • 特征点检测
    • 源码
    • 应用

前言

图像拼接|——OpenCV3.4 stitching模块分析(一)特征点检测 

参考opencv_赵春江的专栏_zhaocj-CSDN博客

特征点检测

OpenCV3.4中实现了surf、orb、sift等特征检测算法,默认的是surf。特征检测算法的实现主要包含在 "opencv2/stitching/detail/matchers.hpp" 中。

源码

首先定义了一个ImageFeatures结构体用于存放特征信息,包括图片序号、尺寸、特征点信息及描述子矩阵:

定义FeaturesFinder基类,其中的成员函数find()是用来寻找特征信息:

FeaturesFinder基类派生出SurfFeaturesFinder、SiftFeaturesFinder、OrbFeaturesFinder等派生类。SurfFeaturesFinder派生类定义:

class CV_EXPORTS SurfFeaturesFinder : 
           

SiftFeaturesFinder派生类定义:

class CV_EXPORTS SiftFeaturesFinder : 
           

OrbFeaturesFinder派生类定义:

class CV_EXPORTS OrbFeaturesFinder : 
           

关于各个特征检测算法的具体实现,就不具体展开了,一般只要知道怎样调用高级API即可。

应用

#include 
           

运行结果:

opencv3图像拼接_图像拼接|——OpenCV3.4 stitching模块分析(一)前言
opencv3图像拼接_图像拼接|——OpenCV3.4 stitching模块分析(一)前言
opencv3图像拼接_图像拼接|——OpenCV3.4 stitching模块分析(一)前言
opencv3图像拼接_图像拼接|——OpenCV3.4 stitching模块分析(一)前言

<<< 左右滑动见更多 >>> Number of surf keypoints: 1403 Number of orb keypoints: 1346 Number of sift keypoints: 1287

主观视觉上还是SIFT更稳健一些,不过stitching默认使用的是surf。