Feature #3957
This commit is contained in:

committed by
Maksim Shabunin

parent
5cdf0e3e89
commit
297808e6b9
@@ -71,12 +71,17 @@ namespace {
|
||||
}
|
||||
|
||||
int main(int ac, char** av) {
|
||||
|
||||
if (ac != 2) {
|
||||
cv::CommandLineParser parser(ac, av, "{help h||}{@input||}");
|
||||
if (parser.has("help"))
|
||||
{
|
||||
help(av);
|
||||
return 0;
|
||||
}
|
||||
std::string arg = parser.get<std::string>("@input");
|
||||
if (arg.empty()) {
|
||||
help(av);
|
||||
return 1;
|
||||
}
|
||||
std::string arg = av[1];
|
||||
VideoCapture capture(arg); //try to open string, this will attempt to open it as a video file or image sequence
|
||||
if (!capture.isOpened()) //if this fails, try to open as a video camera, through the use of an integer param
|
||||
capture.open(atoi(arg.c_str()));
|
||||
|
Reference in New Issue
Block a user