samples: use findFile() in "cpp"
This commit is contained in:
committed by
Alexander Alekhin
parent
2fa9bd221d
commit
c4c31f5bba
+3
-3
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user