我提供一個製做課件過程當中的.cache版本ios
// opencvtest.cpp : 此文件包含 "main" 函數。程序執行將在此處開始並結束。
#
include
"pch.h"
#
include
<iostream
>
#
include
<opencv2
/core
/utility.hpp
>
#
include
"opencv2/video/tracking.hpp"
#
include
"opencv2/imgproc.hpp"
#
include
"opencv2/videoio.hpp"
#
include
"opencv2/highgui.hpp"
#
include
"opencv2/xfeatures2d.hpp"
#
include
<iostream
>
#
include
<ctype.h
>
using
namespace cv;
using
namespace std;
using
namespace xfeatures2d;
int main()
{
Mat matSrc
= imread(
"e:/template/lena.jpg");
Mat gray;
Mat draw;
cvtColor(matSrc, gray, COLOR_BGR2GRAY);
Mat descriptors;
std
:
:vector
<KeyPoint
> keypoints;
// 生產sift結構
Ptr
<SiftFeatureDetector
> siftFD
= SiftFeatureDetector
:
:create();
siftFD
-
>detectAndCompute(gray, Mat(), keypoints, draw);
drawKeypoints(gray, keypoints, gray, Scalar(
0,
0,
255), DrawMatchesFlags
:
:DEFAULT);
imshow(
"gray", gray);
waitKey(
0);
return
0 ;
}