Skip to content

Adding example 16-02 which does feature matching (not in book) #58

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jul 5, 2017
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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