1 | initial version |
this has nothing to do with opencv, it is all about argc/argv argument parsing
the problem is here:
if (argc != 1){
return -1;
}
your program will always return -1, if you actually give it an argument (because argc will be 2 then, remember, argv[0] is the program name) . so , change it to, e.g. :
if (argc < 2) {
cerr << "this program expects a path to an image !" << endl;
return -1;
}