11
11
#include < opencv2/highgui/highgui.hpp>
12
12
#include < opencv2/features2d.hpp>
13
13
#include < opencv2/xfeatures2d.hpp>
14
+ #include < opencv2/xfeatures2d/nonfree.hpp>
14
15
#include < opencv2/calib3d.hpp>
15
16
#include < opencv2/imgproc.hpp>
16
17
#include < opencv2/core/utility.hpp>
@@ -139,20 +140,20 @@ inline void findKeyPointsHomography(vector<KeyPoint>& kpts1, vector<KeyPoint>& k
139
140
140
141
int main (int argc, char ** argv) {
141
142
// Program expects at least four arguments:
142
- // - descriptors type ("surf", "sink ", "orb", "brisk",
143
+ // - descriptors type ("surf", "sift ", "orb", "brisk",
143
144
// "kaze", "akaze", "freak", "daisy", "brief").
144
145
// For "brief", "freak" and "daisy" you also need a prefix
145
146
// that is either "blob" or "fast" (e.g. "fastbrief", "blobdaisy")
146
147
// - match algorithm ("bf", "knn")
147
148
// - path to the object image file
148
149
// - path to the scene image file
149
150
//
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 " ;
152
153
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> "
154
155
<< " <path/image_file1> <path/image_file2>\n "
155
- << " to run this demo\n\n "
156
+ << " To run this demo\n\n "
156
157
<< " Program expects at least four arguments:\n "
157
158
<< " - descriptors type (\" surf\" , \" sink\" , \" orb\" , \" brisk\" ,\n "
158
159
<< " \" kaze\" , \" akaze\" , \" freak\" , \" daisy\" , \" brief\" ).\n "
@@ -163,8 +164,8 @@ int main(int argc, char** argv) {
163
164
<< " - path to the object image file\n "
164
165
<< " - path to the scene image file\n\n "
165
166
<< " 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 "
168
169
<< std::endl;
169
170
exit (1 );
170
171
}
0 commit comments