some improvements on tutorials
This commit is contained in:
@@ -45,16 +45,11 @@ int main( int argc, char** argv )
|
||||
bool needToInit = false;
|
||||
bool nightMode = false;
|
||||
|
||||
cv::CommandLineParser parser(argc, argv, "{@input||}{help h||}");
|
||||
help();
|
||||
cv::CommandLineParser parser(argc, argv, "{@input|0|}");
|
||||
string input = parser.get<string>("@input");
|
||||
if (parser.has("help"))
|
||||
{
|
||||
help();
|
||||
return 0;
|
||||
}
|
||||
if( input.empty() )
|
||||
cap.open(0);
|
||||
else if( input.size() == 1 && isdigit(input[0]) )
|
||||
|
||||
if( input.size() == 1 && isdigit(input[0]) )
|
||||
cap.open(input[0] - '0');
|
||||
else
|
||||
cap.open(input);
|
||||
|
||||
Reference in New Issue
Block a user