1111#include < opencv2/highgui/highgui.hpp>
1212#include < opencv2/features2d.hpp>
1313#include < opencv2/xfeatures2d.hpp>
14+ #include < opencv2/xfeatures2d/nonfree.hpp>
1415#include < opencv2/calib3d.hpp>
1516#include < opencv2/imgproc.hpp>
1617#include < opencv2/core/utility.hpp>
@@ -139,20 +140,20 @@ inline void findKeyPointsHomography(vector<KeyPoint>& kpts1, vector<KeyPoint>& k
139140
140141int main (int argc, char ** argv) {
141142 // Program expects at least four arguments:
142- // - descriptors type ("surf", "sink ", "orb", "brisk",
143+ // - descriptors type ("surf", "sift ", "orb", "brisk",
143144 // "kaze", "akaze", "freak", "daisy", "brief").
144145 // For "brief", "freak" and "daisy" you also need a prefix
145146 // that is either "blob" or "fast" (e.g. "fastbrief", "blobdaisy")
146147 // - match algorithm ("bf", "knn")
147148 // - path to the object image file
148149 // - path to the scene image file
149150 //
150- if (argc < 5 ) {
151- cerr << " \n Error: wrong number of arguments.\n " ;
151+ if (argc != 5 ) {
152+ cerr << " \n Error: wrong (you had: " << argc << " ) number of arguments (should be 5) .\n " ;
152153 cerr << " \n Example 16-2. 2D Feature detectors and 2D Extra Features framework\n\n "
153- << " Use:\n " << argv[0 ] << " <descriptors_type> <matching_algirthm> "
154+ << " Use:\n " << argv[0 ] << " <descriptors_type> <matching_algirthm> "
154155 << " <path/image_file1> <path/image_file2>\n "
155- << " to run this demo\n\n "
156+ << " To run this demo\n\n "
156157 << " Program expects at least four arguments:\n "
157158 << " - descriptors type (\" surf\" , \" sink\" , \" orb\" , \" brisk\" ,\n "
158159 << " \" kaze\" , \" akaze\" , \" freak\" , \" daisy\" , \" brief\" ).\n "
@@ -163,8 +164,8 @@ int main(int argc, char** argv) {
163164 << " - path to the object image file\n "
164165 << " - path to the scene image file\n\n "
165166 << " Examples:\n "
166- << argv[0 ] << " surf knn box.png box_in_scene.png\n "
167- << argv[0 ] << " fastfreak bf box.png box_in_scene.png\n "
167+ << argv[0 ] << " surf knn ../ box.png ../ box_in_scene.png\n "
168+ << argv[0 ] << " fastfreak bf ../ box.png ../ box_in_scene.png\n "
168169 << std::endl;
169170 exit (1 );
170171 }
0 commit comments