samples: use findFile() in "cpp"

This commit is contained in:
Alexander Alekhin
2018-10-31 15:48:56 +03:00
committed by Alexander Alekhin
parent 2fa9bd221d
commit c4c31f5bba
52 changed files with 359 additions and 286 deletions
+2 -2
View File
@@ -276,7 +276,7 @@ static void on_mouse( int event, int x, int y, int flags, void* param )
int main( int argc, char** argv )
{
cv::CommandLineParser parser(argc, argv, "{@input| ../data/messi5.jpg |}");
cv::CommandLineParser parser(argc, argv, "{@input| messi5.jpg |}");
help();
string filename = parser.get<string>("@input");
@@ -285,7 +285,7 @@ int main( int argc, char** argv )
cout << "\nDurn, empty filename" << endl;
return 1;
}
Mat image = imread( filename, 1 );
Mat image = imread(samples::findFile(filename), IMREAD_COLOR);
if( image.empty() )
{
cout << "\n Durn, couldn't read image filename " << filename << endl;