From 1d851da86311b4807c87eef1ea3133509b6bdcda Mon Sep 17 00:00:00 2001 From: Gary Bradski Date: Wed, 5 Jul 2017 22:08:35 +0000 Subject: [PATCH] Adding example 16-02 which does feature matching (not in book) --- example_16-02.cpp | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/example_16-02.cpp b/example_16-02.cpp index 569af31..4da6ce8 100644 --- a/example_16-02.cpp +++ b/example_16-02.cpp @@ -11,6 +11,7 @@ #include #include #include +#include #include #include #include @@ -139,7 +140,7 @@ inline void findKeyPointsHomography(vector& kpts1, vector& 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") @@ -147,12 +148,12 @@ int main(int argc, char** argv) { // - 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] << " " + << "Use:\n" << argv[0] << " " << " \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" @@ -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); }