Skip to content

Instantly share code, notes, and snippets.

@tishibas
Created January 31, 2015 06:00
Show Gist options
  • Save tishibas/d49def350ebd84f666fa to your computer and use it in GitHub Desktop.
Save tishibas/d49def350ebd84f666fa to your computer and use it in GitHub Desktop.
Usage of AKAZE detector with OpenCV-3.0.0-beta
#include <iostream>
#include <vector>
#include <opencv2/opencv.hpp>
using namespace std;
using namespace cv;
int main(){
Ptr<AKAZE> akaze = AKAZE::create();
Mat image = imread("test.jpg");
std::vector<cv::KeyPoint> keypoints;
cv::Mat descriptors;
cv::Mat gimage;
cv::cvtColor(image, gimage, cv::COLOR_BGR2GRAY);
akaze->detectAndCompute(gimage, cv::noArray(), keypoints, descriptors);
cv::drawKeypoints(image, keypoints, image, cv::Scalar::all(-1),cv::DrawMatchesFlags::DRAW_RICH_KEYPOINTS);
cv::imshow( "AKAZE image", image );
cv::waitKey(0);
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment