Feature #3957
This commit is contained in:

committed by
Maksim Shabunin

parent
5cdf0e3e89
commit
297808e6b9
@@ -37,8 +37,6 @@ static void onMouse( int event, int x, int y, int /*flags*/, void* /*param*/ )
|
||||
|
||||
int main( int argc, char** argv )
|
||||
{
|
||||
help();
|
||||
|
||||
VideoCapture cap;
|
||||
TermCriteria termcrit(TermCriteria::COUNT|TermCriteria::EPS,20,0.03);
|
||||
Size subPixWinSize(10,10), winSize(31,31);
|
||||
@@ -47,10 +45,19 @@ int main( int argc, char** argv )
|
||||
bool needToInit = false;
|
||||
bool nightMode = false;
|
||||
|
||||
if( argc == 1 || (argc == 2 && strlen(argv[1]) == 1 && isdigit(argv[1][0])))
|
||||
cap.open(argc == 2 ? argv[1][0] - '0' : 0);
|
||||
else if( argc == 2 )
|
||||
cap.open(argv[1]);
|
||||
cv::CommandLineParser parser(argc, argv, "{@input||}{help h||}");
|
||||
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]) )
|
||||
cap.open(input[0] - '0');
|
||||
else
|
||||
cap.open(input);
|
||||
|
||||
if( !cap.isOpened() )
|
||||
{
|
||||
|
Reference in New Issue
Block a user