using argv[0] represent binary executable files' name in help() function

in sample codes instead of cpp files' name.
This commit is contained in:
MoonChasing
2020-02-23 21:38:04 +08:00
parent 8b5efc6f4c
commit 98db891851
30 changed files with 218 additions and 207 deletions
+3 -3
View File
@@ -9,13 +9,13 @@
using namespace cv;
using namespace std;
static void help()
static void help(char** argv)
{
cout <<
"\nThis program demonstrates Laplace point/edge detection using OpenCV function Laplacian()\n"
"It captures from the camera of your choice: 0, 1, ... default 0\n"
"Call:\n"
"./laplace -c=<camera #, default 0> -p=<index of the frame to be decoded/captured next>\n" << endl;
<< argv[0] << " -c=<camera #, default 0> -p=<index of the frame to be decoded/captured next>\n" << endl;
}
enum {GAUSSIAN, BLUR, MEDIAN};
@@ -26,7 +26,7 @@ int smoothType = GAUSSIAN;
int main( int argc, char** argv )
{
cv::CommandLineParser parser(argc, argv, "{ c | 0 | }{ p | | }");
help();
help(argv);
VideoCapture cap;
string camera = parser.get<string>("c");