Feature point detection (1): ORB feature point detection
Foreword
ORB feature points add scale and direction descriptions on the basis of FAST feature points and BRIEF feature descriptors, first explain the principle of ORB feature points, and then use code to achieve feature point extraction
ORB feature points
Excerpt from the paper: (It ’s too much time and effort to knock yourself)
[1] Xu Kuan. Research on binocular visual SLAM fusion of IMU information [D]. Harbin Institute of Technology, 2018.
1. FAST feature points
2. BREIF feature descriptor
3. ORB characteristics
Code
win10 + VS2015 + OpenCV3.3.0 (implemented by opencv own function)
#include"stdafx.h"
#include <iostream>
#include <opencv2/opencv.hpp>
using namespace std;
using namespace cv;
int main(int argc, char** argv)
{
//读图
Mat img = imread("E:/images/1.jpg");
Mat img_gray = img;
Mat img_output;
//转为灰度图
cvtColor(img_gray, img_gray, CV_RGB2GRAY);
//提取特征点
vector<KeyPoint> keypoints;
Ptr<FeatureDetector> detector = ORB::create();
detector->detect(img_gray, keypoints);
//计算描述子
Mat descriptors;
Ptr<DescriptorExtractor> descriptor = ORB::create();
descriptor->compute(img_gray, keypoints, descriptors);
//画出特征点
drawKeypoints(img, keypoints, img_output, Scalar::all(-1), DrawMatchesFlags::DEFAULT);
//显示
imshow("opencv提取ORB特征点", img_output);
waitKey(0);
return 0;
}