OpenCV3.1 xfeatures2d::SIFT 使用
2016-12-10 00:00
375 查看
OpenCV3.1 SIFT使用
OpenCV3对OpenCV的模块进行了调整,将开发中与nofree模块放在 了OpenCV_contrib中(包含SIFT),gitHub上的官方项目分成了两个,opencv 与 opencv_contrib。所以,要使用sift接口需在opencv3.1基础上,再安装opencv_contrib。本文主要记录如何安装opencv_contrib,配置Xcode,sift接口的用法。环境:OSX + Xcode + OpenCV3.1
OpenCV31 SIFT使用
install opencv_contrib
configuration Xcode
pro_name Build Setting Search Paths
pro_name Build Setting Other Linker Flags
sample of sift
References
install opencv_contrib
download contrib source code https://github.com/Itseez/opencv_contrib, follow README.md to install$ cd <opencv_build_directory> $ cmake -DOPENCV_EXTRA_MODULES_PATH=<opencv_contrib>/modules <opencv_source_directory> $ make -j5 $ sudo make install
Where
<opencv_build_directory>and
<opencv_source_directory>is directory in opencv3.1 install tutorial
configuration Xcode
like How to develop OpenCV with Xcodepro_name Build Setting > Search Paths
/usr/local/lib/usr/local/include
pro_name Build Setting >Other Linker Flags
-lopencv_stitching -lopencv_superres -lopencv_videostab -lopencv_aruco -lopencv_bgsegm -lopencv_bioinspired -lopencv_ccalib -lopencv_dnn -lopencv_dpm -lopencv_fuzzy -lopencv_line_descriptor -lopencv_optflow -lopencv_plot -lopencv_reg -lopencv_saliency -lopencv_stereo -lopencv_structured_light -lopencv_rgbd -lopencv_surface_matching -lopencv_tracking -lopencv_datasets -lopencv_text -lopencv_face -lopencv_xfeatures2d -lopencv_shape -lopencv_video -lopencv_ximgproc -lopencv_calib3d -lopencv_features2d -lopencv_flann -lopencv_xobjdetect -lopencv_objdetect -lopencv_ml -lopencv_xphoto -lippicv -lopencv_highgui -lopencv_videoio -lopencv_imgcodecs -lopencv_photo -lopencv_imgproc -lopencv_coresample of sift
sample in (souce_dir)/samples/cpp/tutorial_code/xfeatures2D/LATCH_match.cpp or bellow#include "opencv2/xfeatures2d.hpp" // // now, you can no more create an instance on the 'stack', like in the tutorial // (yea, noticed for a fix/pr). // you will have to use cv::Ptr all the way down: // cv::Ptr<Feature2D> f2d = xfeatures2d::SIFT::create(); //cv::Ptr<Feature2D> f2d = xfeatures2d::SURF::create(); //cv::Ptr<Feature2D> f2d = ORB::create(); // you get the picture, i hope.. //-- Step 1: Detect the keypoints: std::vector<KeyPoint> keypoints_1, keypoints_2; f2d->detect( img_1, keypoints_1 ); f2d->detect( img_2, keypoints_2 ); //-- Step 2: Calculate descriptors (feature vectors) Mat descriptors_1, descriptors_2; f2d->compute( img_1, keypoints_1, descriptors_1 ); f2d->compute( img_2, keypoints_2, descriptors_2 ); //-- Step 3: Matching descriptor vectors using BFMatcher : BFMatcher matcher; std::vector< DMatch > matches; matcher.match( descriptors_1, descriptors_2, matches );
References
https://github.com/Itseez/opencv_contribhttps://github.com/Itseez/opencv
http://blog.csdn.net/lijiang1991/article/details/50756065
http://docs.opencv.org/3.1.0/d5/d3c/classcv_1_1xfeatures2d_1_1SIFT.html#gsc.tab=0
相关文章推荐
- OpenCV3.1 xfeatures2d::SIFT 使用
- OpenCV3.1 xfeatures2d::SIFT 使用
- python3.5 opencv3.1 不能使用sift, surf。
- OpenCV3.1使用SIFT
- opencv2.4.6版本下使用sift等特征
- OpenCV2.4.9新版本使用问题---sift,surf无法使用
- opencv3.1中svm的使用范例
- 使用OPENCV自带的sift提取特征
- python3.5 使用pip安装opencv3.1 ImportError: DLLL load failed.
- opencv 中sift 的使用
- OpenCV中SUFR、SIFT无法使用的原因及解决办法
- 使用Opencv2.4.9进行SIFT特征点提取和匹配
- opencv SURF、SIFT的使用
- SIFT:第一步使用OpenCV构建DOG金字塔
- OpenCV3如何使用SIFT和SURF Where did SIFT and SURF go in OpenCV 3?
- openCV3.1中的sift和surf编译
- 基于Opencv的SIFT代码,使用FLANN匹配
- opencv下SIFT使用
- 使用OPENCV自带的sift提取特征
- mfc使用opencv3.1