1
0
mirror of https://github.com/opencv/opencv.git synced 2026-07-28 23:03:03 +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
+4 -4
View File
@@ -39,11 +39,11 @@ static void onTrackbar(int, void*)
imshow(window_name2, cedge);
}
static void help()
static void help(const char** argv)
{
printf("\nThis sample demonstrates Canny edge detection\n"
"Call:\n"
" /.edge [image_name -- Default is fruits.jpg]\n\n");
" %s [image_name -- Default is fruits.jpg]\n\n", argv[0]);
}
const char* keys =
@@ -53,7 +53,7 @@ const char* keys =
int main( int argc, const char** argv )
{
help();
help(argv);
CommandLineParser parser(argc, argv, keys);
string filename = parser.get<string>(0);
@@ -61,7 +61,7 @@ int main( int argc, const char** argv )
if(image.empty())
{
printf("Cannot read image file: %s\n", filename.c_str());
help();
help(argv);
return -1;
}
cedge.create(image.size(), image.type());