Dlib库【9】——Surf特征点
来源:互联网 发布:电影票网络代售商 编辑:程序博客网 时间:2024/06/06 00:55
配置Dlib环境: 链接
效果如图所示:
感觉Slam里会用得比较多,图片旋转平移之后取surf特征点连线…………
代码如下:
// The contents of this file are in the public domain. See LICENSE_FOR_EXAMPLE_PROGRAMS.txt/*This is a simple example illustrating the use of the get_surf_points() function. Itpulls out SURF points from an input image and displays them on the screen as an overlayon the image.For a description of the SURF algorithm you should consult the following papers:This is the original paper which introduced the algorithm:SURF: Speeded Up Robust FeaturesBy Herbert Bay, Tinne Tuytelaars, and Luc Van GoolThis paper provides a nice detailed overview of how the algorithm works:Notes on the OpenSURF Library by Christopher Evans*/#define DLIB_JPEG_SUPPORT#include <dlib/image_keypoint/draw_surf_points.h>#include <dlib/image_io.h>#include <dlib/image_keypoint.h>#include <fstream>using namespace std;using namespace dlib;// ----------------------------------------------------------------------------int main(int argc, char** argv){try{// make sure the user entered an argument to this programif (argc != 2){cout << "error, you have to enter a BMP file as an argument to this program" << endl;return 1;}// Here we declare an image object that can store rgb_pixels. Note that in dlib// there is no explicit image object, just a 2D array and various pixel types. array2d<rgb_pixel> img;// Now load the image file into our image. If something is wrong then load_image()// will throw an exception. Also, if you linked with libpng and libjpeg then// load_image() can load PNG and JPEG files in addition to BMP files. load_image(img, argv[1]);// Get SURF points from the image. Note that get_surf_points() has some optional// arguments that allow you to control the number of points you get back. Here we// simply take the default.std::vector<surf_point> sp = get_surf_points(img);cout << "number of SURF points found: " << sp.size() << endl;if (sp.size() > 0){// A surf_point object contains a lot of information describing each point.// The most important fields are shown below:cout << "center of first SURF point: " << sp[0].p.center << endl;cout << "pyramid scale: " << sp[0].p.scale << endl;cout << "SURF descriptor: \n" << sp[0].des << endl;}// Create a window to display the input image and the SURF points. (Note that// you can zoom into the window by holding CTRL and scrolling the mouse wheel)image_window my_window(img);draw_surf_points(my_window, sp);// wait until the user closes the window before we let the program // terminate.my_window.wait_until_closed();}catch (exception& e){cout << "exception thrown: " << e.what() << endl;}}// ----------------------------------------------------------------------------
233
阅读全文
0 0
- Dlib库【9】——Surf特征点
- 学习OpenCV——Surf(特征点篇)&flann
- 学习OpenCV——Surf(特征点篇)&flann
- 学习OpenCV——Surf(特征点篇)&flann
- 学习OpenCV——Surf(特征点篇)&flann
- 图像局部显著性—点特征(SURF)
- SURF特征点提取
- SURF特征点提取
- SurF特征点检测
- SURF特征点检测
- SURF特征点描述
- Surf特征点检测
- 图像特征— —SURF特征
- 使用Dlib库进行68个人脸特征点检测
- 特征点检测(surf算法)
- surf特征点检测算法
- Surf特征匹配点提纯
- 学习OpenCV——Surf(特征点篇)&flann(一)
- C语言获取Shell返回结果的实现方法
- Gym_100971_Triangles
- Apache Beam发布第一个稳定版本
- 多线程编程-互斥锁
- Android 进阶学习笔记
- Dlib库【9】——Surf特征点
- strdup函数
- 4814: [Cqoi2017]小Q的草稿
- CR, LF, CR/LF 回车 换行
- 微信小程序 fixed 解决 textarea 的 placeholder 不固定问题
- 多态性实现机制——静态分派与动态分派
- 机器学习算法常用指标总结
- Oracle存储过程详解
- 欢迎使用CSDN-markdown编辑器