OpenCV图像匹配算法之surf详解编程语言
2023-06-13 09:20:30 时间
SurfFeatureDetector surf_detector(minHessian) ;
SurfDescriptorExtractor surf_descriptor ;
vector KeyPoint kpts1_surf, kpts2_surf;
Mat desc1_surf, desc2_surf;
Ptr cv::DescriptorMatcher matcher_l2 = DescriptorMatcher::create("BruteForce"); //欧氏距离匹配
vector vector DMatch dmatches_surf;
vector Point2f matches_surf, inliers_surf;
surf_detector.detect(img1,kpts1_surf);
surf_detector.detect(img2,kpts2_surf);
info.n1 = kpts1_surf.size();
info.n2 = kpts2_surf.size();
surf_descriptor.compute(img1,kpts1_surf,desc1_surf);
surf_descriptor.compute(img2,kpts2_surf,desc2_surf);
matcher_l2- knnMatch(desc1_surf,desc2_surf,dmatches_surf,2);
matches2points_nndr(kpts1_surf,kpts2_surf,dmatches_surf,matches_surf,DRATIO);
info.m=matches_surf.size()/2;
compute_inliers_ransac(matches_surf,inliers_surf,MIN_H_ERROR,false);
info.rm=inliers_surf.size()/2;
t2=cvGetTickCount();
info.t=(t2-t1)/1000000.0/cvGetTickFrequency();
Mat img1_rgb_surf = imread(path1,1);
Mat img2_rgb_surf = imread(path2,1);
Mat img_com_surf = Mat(Size(img1.cols*2,img1.rows),CV_8UC3);
if(show == true)
draw_inliers(img1_rgb_surf,img2_rgb_surf,img_com_surf,inliers_surf,2);
imshow("surf",img_com_surf);
waitKey(0);
return;
}
使用
INFO surf_info; surf(path1,path2,surf_info,false); showInfo(surf_info);
11087.html
cjava相关文章
- Canny算法解析,opencv源码实现及实例[通俗易懂]
- OpenCV视频识别检测人数跟踪统计
- OpenCV 人脸识别LBPH算法分析
- Py之cv2:cv2库(OpenCV,opencv-python)的简介、安装、使用方法(常见函数、方法等)最强详细攻略[通俗易懂]
- Opencv学习笔记(九)光流法
- pycharm配置opencv环境_pycharm opencv安装
- Python-OpenCV,基于标准文档的实例(二)
- opencv中scalar_opencv ffmpeg
- OPENCV轮廓提取findContours和drawContours
- opencv(4.5.3)-python(十二)--图像阈值处理
- opencv(4.5.3)-python(十五)--图像梯度
- 干货 | 轮廓逼近原理与OpenCV应用(附Python-OpenCV文档下载)
- OpenCv4.4.0+Qt5.12.2+OpenCv-Contrib-4.4.0
- Linux 安装OpenCV简易指南(linux安装opencv)
- 手把手教你如何用 OpenCV + Python 实现人脸识别
- python中使用OpenCV进行人脸检测的例子