使用 OpenCV 2.2 筛选实现 [英] Sift implementation with OpenCV 2.2
本文介绍了使用 OpenCV 2.2 筛选实现的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
有人知道 SIFT 实现示例与 OpenCV 2.2 的链接吗?问候,
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 筛选实现的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文