1
0
mirror of https://github.com/opencv/opencv.git synced 2026-07-25 13:23:02 +04:00

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
+5 -5
View File
@@ -8,14 +8,14 @@
using namespace cv;
using namespace std;
static void help()
static void help(char** argv)
{
cout <<
"\nThis program demonstrates dense optical flow algorithm by Gunnar Farneback\n"
"Mainly the function: calcOpticalFlowFarneback()\n"
"Call:\n"
"./fback\n"
"This reads from video camera 0\n" << endl;
<< argv[0]
<< "This reads from video camera 0\n" << endl;
}
static void drawOptFlowMap(const Mat& flow, Mat& cflowmap, int step,
double, const Scalar& color)
@@ -35,11 +35,11 @@ int main(int argc, char** argv)
cv::CommandLineParser parser(argc, argv, "{help h||}");
if (parser.has("help"))
{
help();
help(argv);
return 0;
}
VideoCapture cap(0);
help();
help(argv);
if( !cap.isOpened() )
return -1;