Feature #3957
This commit is contained in:

committed by
Maksim Shabunin

parent
5cdf0e3e89
commit
297808e6b9
@@ -23,14 +23,20 @@ static void help(char** av)
|
||||
|
||||
int main(int ac, char** av)
|
||||
{
|
||||
if (ac < 3)
|
||||
cv::CommandLineParser parser(ac, av, "{help h||}{@output||}");
|
||||
if (parser.has("help"))
|
||||
{
|
||||
help(av);
|
||||
return 0;
|
||||
}
|
||||
string outputname = parser.get<string>("@output");
|
||||
|
||||
if (outputname.empty())
|
||||
{
|
||||
help(av);
|
||||
return 1;
|
||||
}
|
||||
|
||||
string outputname = av[1];
|
||||
|
||||
Mat m = imread(outputname); //check if the output is an image - prevent overwrites!
|
||||
if(!m.empty()){
|
||||
std::cerr << "fail! Please specify an output file, don't want to overwrite you images!" << endl;
|
||||
|
Reference in New Issue
Block a user