This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <iostream> | |
#include <stdio.h> | |
#include <stdlib.h> | |
#include "opencv2/highgui/highgui.hpp" | |
#include "opencv2/imgproc/imgproc.hpp" | |
#include "opencv2/core/core.hpp" | |
#include "opencv2/features2d/features2d.hpp" | |
using namespace std; | |
using namespace cv; | |
//#include "Functions.h" | |
char* source_window = "Source image"; | |
char* corners_window = "Corners detected"; | |
int main() | |
{ | |
Mat src; | |
src = imread("building.jpg",CV_LOAD_IMAGE_GRAYSCALE); | |
if(src.empty()) | |
{ | |
cout << "Could not open or find the image" << std::endl ; | |
return -1; | |
} | |
// -- step 1: Detect the keypoints using SURF Detector | |
int minHessian = 200; | |
SurfFeatureDetector detector(minHessian); | |
vector<KeyPoint> keypoints; | |
detector.detect(src,keypoints); | |
Mat img_keypoints; | |
drawKeypoints(src,keypoints,img_keypoints,Scalar::all(-1), DrawMatchesFlags::DEFAULT); | |
imshow("Keypoins", img_keypoints); | |
waitKey(0); | |
return 0; | |
} | |
No comments:
Post a Comment