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
@@ -14,12 +14,12 @@ static void help()
printf("\nThis program demonstrated the use of the discrete Fourier transform (dft)\n"
"The dft of an image is taken and it's power spectrum is displayed.\n"
"Usage:\n"
"./dft [image_name -- default ../data/lena.jpg]\n");
"./dft [image_name -- default lena.jpg]\n");
}
const char* keys =
{
"{help h||}{@image|../data/lena.jpg|input image file}"
"{help h||}{@image|lena.jpg|input image file}"
};
int main(int argc, const char ** argv)
@@ -32,7 +32,7 @@ int main(int argc, const char ** argv)
return 0;
}
string filename = parser.get<string>(0);
Mat img = imread(filename, IMREAD_GRAYSCALE);
Mat img = imread(samples::findFile(filename), IMREAD_GRAYSCALE);
if( img.empty() )
{
help();