Skip to content

Commit

Permalink
Merge pull request #58 from oreillymedia/gary
Browse files Browse the repository at this point in the history
Adding example 16-02 which does feature matching (not in book)
  • Loading branch information
garybradski authored Jul 5, 2017
2 parents 4a68e85 + 1d851da commit d881dd7
Showing 1 changed file with 8 additions and 7 deletions.
15 changes: 8 additions & 7 deletions example_16-02.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
#include <opencv2/highgui/highgui.hpp>
#include <opencv2/features2d.hpp>
#include <opencv2/xfeatures2d.hpp>
#include <opencv2/xfeatures2d/nonfree.hpp>
#include <opencv2/calib3d.hpp>
#include <opencv2/imgproc.hpp>
#include <opencv2/core/utility.hpp>
Expand Down Expand Up @@ -139,20 +140,20 @@ inline void findKeyPointsHomography(vector<KeyPoint>& kpts1, vector<KeyPoint>& k

int main(int argc, char** argv) {
// Program expects at least four arguments:
// - descriptors type ("surf", "sink", "orb", "brisk",
// - descriptors type ("surf", "sift", "orb", "brisk",
// "kaze", "akaze", "freak", "daisy", "brief").
// For "brief", "freak" and "daisy" you also need a prefix
// that is either "blob" or "fast" (e.g. "fastbrief", "blobdaisy")
// - match algorithm ("bf", "knn")
// - path to the object image file
// - path to the scene image file
//
if (argc < 5) {
cerr << "\nError: wrong number of arguments.\n";
if (argc != 5) {
cerr << "\nError: wrong (you had: " << argc << ") number of arguments (should be 5).\n";
cerr << "\nExample 16-2. 2D Feature detectors and 2D Extra Features framework\n\n"
<< "Use:\n" << argv[0] << "<descriptors_type> <matching_algirthm> "
<< "Use:\n" << argv[0] << " <descriptors_type> <matching_algirthm> "
<< "<path/image_file1> <path/image_file2>\n"
<< "to run this demo\n\n"
<< "To run this demo\n\n"
<< "Program expects at least four arguments:\n"
<< " - descriptors type (\"surf\", \"sink\", \"orb\", \"brisk\",\n"
<< " \"kaze\", \"akaze\", \"freak\", \"daisy\", \"brief\").\n"
Expand All @@ -163,8 +164,8 @@ int main(int argc, char** argv) {
<< " - path to the object image file\n"
<< " - path to the scene image file\n\n"
<< "Examples:\n"
<< argv[0] << " surf knn box.png box_in_scene.png\n"
<< argv[0] << " fastfreak bf box.png box_in_scene.png\n"
<< argv[0] << " surf knn ../box.png ../box_in_scene.png\n"
<< argv[0] << " fastfreak bf ../box.png ../box_in_scene.png\n"
<< std::endl;
exit(1);
}
Expand Down

0 comments on commit d881dd7

Please sign in to comment.