本文介绍了使用OpenCV 2.2快速实施的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
有人知道OpenCV 2.2的SIFT实现示例的链接.问候,
Does someone know the link of example of SIFT implementation with OpenCV 2.2.regards,
推荐答案
下面是一个最小的示例:
Below is a minimal example:
#include <opencv/cv.h>
#include <opencv/highgui.h>
int main(int argc, const char* argv[])
{
const cv::Mat input = cv::imread("input.jpg", 0); //Load as grayscale
cv::SiftFeatureDetector detector;
std::vector<cv::KeyPoint> keypoints;
detector.detect(input, keypoints);
// Add results to image and save.
cv::Mat output;
cv::drawKeypoints(input, keypoints, output);
cv::imwrite("sift_result.jpg", output);
return 0;
}
在OpenCV 2.3上测试
Tested on OpenCV 2.3
这篇关于使用OpenCV 2.2快速实施的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!