Update Samples
This commit is contained in:
committed by
sturkmen72
parent
9ef5373776
commit
f73395122c
@@ -16,9 +16,9 @@ using namespace cv;
|
||||
using namespace std;
|
||||
|
||||
const char* params
|
||||
= "{ help h | | Print usage }"
|
||||
"{ input | ../data/vtest.avi | Path to a video or a sequence of image }"
|
||||
"{ algo | MOG2 | Background subtraction method (KNN, MOG2) }";
|
||||
= "{ help h | | Print usage }"
|
||||
"{ input | vtest.avi | Path to a video or a sequence of image }"
|
||||
"{ algo | MOG2 | Background subtraction method (KNN, MOG2) }";
|
||||
|
||||
int main(int argc, char* argv[])
|
||||
{
|
||||
@@ -41,7 +41,7 @@ int main(int argc, char* argv[])
|
||||
//! [create]
|
||||
|
||||
//! [capture]
|
||||
VideoCapture capture(parser.get<String>("input"));
|
||||
VideoCapture capture( samples::findFile( parser.get<String>("input") ) );
|
||||
if (!capture.isOpened()){
|
||||
//error in opening the video input
|
||||
cerr << "Unable to open: " << parser.get<String>("input") << endl;
|
||||
|
||||
@@ -16,7 +16,7 @@ int main(int argc, char **argv)
|
||||
" https://www.bogotobogo.com/python/OpenCV_Python/images/mean_shift_tracking/slow_traffic_small.mp4";
|
||||
const string keys =
|
||||
"{ h help | | print this help message }"
|
||||
"{ @image |<none>| path to image file }";
|
||||
"{ @image | vtest.avi | path to image file }";
|
||||
CommandLineParser parser(argc, argv, keys);
|
||||
parser.about(about);
|
||||
if (parser.has("help"))
|
||||
@@ -24,7 +24,7 @@ int main(int argc, char **argv)
|
||||
parser.printMessage();
|
||||
return 0;
|
||||
}
|
||||
string filename = parser.get<string>("@image");
|
||||
string filename = samples::findFile(parser.get<string>("@image"));
|
||||
if (!parser.check())
|
||||
{
|
||||
parser.printErrors();
|
||||
|
||||
Reference in New Issue
Block a user