mirror of
https://github.com/zebrajr/opencv.git
synced 2026-01-15 12:15:17 +00:00
Update Samples
This commit is contained in:
committed by
sturkmen72
parent
9ef5373776
commit
f73395122c
@@ -9,12 +9,11 @@
|
||||
using namespace cv;
|
||||
using namespace std;
|
||||
|
||||
static void help()
|
||||
static void help(const char ** argv)
|
||||
{
|
||||
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 lena.jpg]\n");
|
||||
"Usage:\n %s [image_name -- default lena.jpg]\n",argv[0]);
|
||||
}
|
||||
|
||||
const char* keys =
|
||||
@@ -24,18 +23,18 @@ const char* keys =
|
||||
|
||||
int main(int argc, const char ** argv)
|
||||
{
|
||||
help();
|
||||
help(argv);
|
||||
CommandLineParser parser(argc, argv, keys);
|
||||
if (parser.has("help"))
|
||||
{
|
||||
help();
|
||||
help(argv);
|
||||
return 0;
|
||||
}
|
||||
string filename = parser.get<string>(0);
|
||||
Mat img = imread(samples::findFile(filename), IMREAD_GRAYSCALE);
|
||||
if( img.empty() )
|
||||
{
|
||||
help();
|
||||
help(argv);
|
||||
printf("Cannot read image file: %s\n", filename.c_str());
|
||||
return -1;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user