mirror of
https://github.com/opencv/opencv.git
synced 2025-06-07 17:44:04 +08:00
samples: check for valid input in gpu/super_resolution.cpp
This commit is contained in:
parent
b1ed8bc0d1
commit
ddbd074678
@ -55,7 +55,7 @@ static Ptr<cv::superres::DenseOpticalFlowExt> createOptFlow(const string& name,
|
|||||||
int main(int argc, const char* argv[])
|
int main(int argc, const char* argv[])
|
||||||
{
|
{
|
||||||
CommandLineParser cmd(argc, argv,
|
CommandLineParser cmd(argc, argv,
|
||||||
"{ v video | | Input video }"
|
"{ v video | | Input video (mandatory)}"
|
||||||
"{ o output | | Output video }"
|
"{ o output | | Output video }"
|
||||||
"{ s scale | 4 | Scale factor }"
|
"{ s scale | 4 | Scale factor }"
|
||||||
"{ i iterations | 180 | Iteration count }"
|
"{ i iterations | 180 | Iteration count }"
|
||||||
@ -65,14 +65,14 @@ int main(int argc, const char* argv[])
|
|||||||
"{ h help | false | Print help message }"
|
"{ h help | false | Print help message }"
|
||||||
);
|
);
|
||||||
|
|
||||||
if (cmd.get<bool>("help"))
|
const string inputVideoName = cmd.get<string>("video");
|
||||||
|
if (cmd.get<bool>("help") || inputVideoName.empty())
|
||||||
{
|
{
|
||||||
cout << "This sample demonstrates Super Resolution algorithms for video sequence" << endl;
|
cout << "This sample demonstrates Super Resolution algorithms for video sequence" << endl;
|
||||||
cmd.printMessage();
|
cmd.printMessage();
|
||||||
return EXIT_SUCCESS;
|
return EXIT_SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
const string inputVideoName = cmd.get<string>("video");
|
|
||||||
const string outputVideoName = cmd.get<string>("output");
|
const string outputVideoName = cmd.get<string>("output");
|
||||||
const int scale = cmd.get<int>("scale");
|
const int scale = cmd.get<int>("scale");
|
||||||
const int iterations = cmd.get<int>("iterations");
|
const int iterations = cmd.get<int>("iterations");
|
||||||
|
Loading…
Reference in New Issue
Block a user