using argv[0] represent binary executable files' name in help() function
in sample codes instead of cpp files' name.
This commit is contained in:
+16
-16
@@ -7,25 +7,25 @@
|
||||
using namespace std;
|
||||
using namespace cv;
|
||||
|
||||
static void help()
|
||||
static void help(char** argv)
|
||||
{
|
||||
cout << "\nThis program demonstrates GrabCut segmentation -- select an object in a region\n"
|
||||
"and then grabcut will attempt to segment it out.\n"
|
||||
"Call:\n"
|
||||
"./grabcut <image_name>\n"
|
||||
"\nSelect a rectangular area around the object you want to segment\n" <<
|
||||
"\nHot keys: \n"
|
||||
"\tESC - quit the program\n"
|
||||
"\tr - restore the original image\n"
|
||||
"\tn - next iteration\n"
|
||||
"\n"
|
||||
"\tleft mouse button - set rectangle\n"
|
||||
"\n"
|
||||
"\tCTRL+left mouse button - set GC_BGD pixels\n"
|
||||
"\tSHIFT+left mouse button - set GC_FGD pixels\n"
|
||||
"\n"
|
||||
"\tCTRL+right mouse button - set GC_PR_BGD pixels\n"
|
||||
"\tSHIFT+right mouse button - set GC_PR_FGD pixels\n" << endl;
|
||||
<< argv[0] << " <image_name>\n"
|
||||
"\nSelect a rectangular area around the object you want to segment\n" <<
|
||||
"\nHot keys: \n"
|
||||
"\tESC - quit the program\n"
|
||||
"\tr - restore the original image\n"
|
||||
"\tn - next iteration\n"
|
||||
"\n"
|
||||
"\tleft mouse button - set rectangle\n"
|
||||
"\n"
|
||||
"\tCTRL+left mouse button - set GC_BGD pixels\n"
|
||||
"\tSHIFT+left mouse button - set GC_FGD pixels\n"
|
||||
"\n"
|
||||
"\tCTRL+right mouse button - set GC_PR_BGD pixels\n"
|
||||
"\tSHIFT+right mouse button - set GC_PR_FGD pixels\n" << endl;
|
||||
}
|
||||
|
||||
const Scalar RED = Scalar(0,0,255);
|
||||
@@ -277,7 +277,7 @@ static void on_mouse( int event, int x, int y, int flags, void* param )
|
||||
int main( int argc, char** argv )
|
||||
{
|
||||
cv::CommandLineParser parser(argc, argv, "{@input| messi5.jpg |}");
|
||||
help();
|
||||
help(argv);
|
||||
|
||||
string filename = parser.get<string>("@input");
|
||||
if( filename.empty() )
|
||||
|
||||
Reference in New Issue
Block a user