Last active
August 29, 2015 14:10
-
-
Save kellegous/0afdea5efb150048e0cc to your computer and use it in GitHub Desktop.
read-features.cc
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
| bool ReadFeatureDescriptors(const std::string& path, | |
| std::vector<cv::KeyPoint>& keypoints, | |
| cv::Mat& descriptors) { | |
| cv::Mat img = cv::imread(path.c_str(), CV_LOAD_IMAGE_GRAYSCALE); | |
| if (!img.data) { | |
| return false; | |
| } | |
| cv::SurfFeatureDetector detector; | |
| cv::SurfDescriptorExtractor extractor; | |
| detector.detect(img, keypoints); | |
| extractor.compute(img, keypoints, descriptors); | |
| return true; | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment