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
+3 -3
View File
@@ -43,12 +43,12 @@ static void help()
{
printf("\nThis sample demonstrates Canny edge detection\n"
"Call:\n"
" /.edge [image_name -- Default is ../data/fruits.jpg]\n\n");
" /.edge [image_name -- Default is fruits.jpg]\n\n");
}
const char* keys =
{
"{help h||}{@image |../data/fruits.jpg|input image name}"
"{help h||}{@image |fruits.jpg|input image name}"
};
int main( int argc, const char** argv )
@@ -57,7 +57,7 @@ int main( int argc, const char** argv )
CommandLineParser parser(argc, argv, keys);
string filename = parser.get<string>(0);
image = imread(filename, IMREAD_COLOR);
image = imread(samples::findFile(filename), IMREAD_COLOR);
if(image.empty())
{
printf("Cannot read image file: %s\n", filename.c_str());