特征点

openmv之特征点检测

淺唱寂寞╮ 提交于 2020-01-29 22:04:14
本例程利用 FAST/AGAST 算法进行特征提取,并且进行目标追踪,仅支持灰度图。 注意:本例程会把程序运行最开始的十秒左右出现的物体作为目标特征,请在程序运行的最开始,将目标物体放在摄像头中央识别,直至出现特征角点,证明已经识别记录目标特征。 匹配过程中,如果画面出现十字和矩形框,证明匹配成功。 1 # Object tracking with keypoints example. 2 # Show the camera an object and then run the script. A set of keypoints will be extracted 3 # once and then tracked in the following frames. If you want a new set of keypoints re-run 4 # the script. NOTE: see the docs for arguments to tune find_keypoints and match_keypoints. 5 import sensor, time, image 6 7 # Reset sensor 8 sensor.reset() 9 10 # Sensor settings 11 sensor.set_contrast(3) 12 sensor.set

BF和FLANN特征匹配

不羁岁月 提交于 2019-12-06 12:23:29
BF特征点匹配原理: 暴力匹配 (段匹配) 1 #include <opencv2/opencv.hpp> 2 #include <opencv2/xfeatures2d.hpp> 3 #include <iostream> 4 5 using namespace cv; 6 using namespace std; 7 using namespace cv::xfeatures2d; 8 9 int main(int argc, char** argv) { 10 Mat img1 = imread("L:/4-1.jpg", IMREAD_GRAYSCALE); 11 Mat img2 = imread("L:/4.jpg", IMREAD_GRAYSCALE); 12 if (!img1.data || !img2.data) { 13 return -1; 14 } 15 imshow("image1", img1); 16 imshow("image2", img2); 17 18 int minHessian = 400; //海深矩阵参数 19 Ptr<SURF> detector = SURF::create(minHessian); //SURF指针,创建海深矩阵 20 vector<KeyPoint> keypoints_1; //创建关键点1 21