mirror of
https://github.com/opencv/opencv.git
synced 2026-07-25 21:33:04 +04:00
Merge remote-tracking branch 'upstream/3.4' into merge-3.4
This commit is contained in:
@@ -36,12 +36,12 @@ int main( void )
|
||||
|
||||
//![load]
|
||||
/// Read images ( both have to be of the same size and type )
|
||||
src1 = imread( "../data/LinuxLogo.jpg" );
|
||||
src2 = imread( "../data/WindowsLogo.jpg" );
|
||||
src1 = imread( samples::findFile("LinuxLogo.jpg") );
|
||||
src2 = imread( samples::findFile("WindowsLogo.jpg") );
|
||||
//![load]
|
||||
|
||||
if( src1.empty() ) { cout << "Error loading src1" << endl; return -1; }
|
||||
if( src2.empty() ) { cout << "Error loading src2" << endl; return -1; }
|
||||
if( src1.empty() ) { cout << "Error loading src1" << endl; return EXIT_FAILURE; }
|
||||
if( src2.empty() ) { cout << "Error loading src2" << endl; return EXIT_FAILURE; }
|
||||
|
||||
//![blend_images]
|
||||
beta = ( 1.0 - alpha );
|
||||
|
||||
+8
-8
@@ -8,25 +8,25 @@
|
||||
using namespace cv;
|
||||
using namespace std;
|
||||
|
||||
static void help(void)
|
||||
static void help(char ** argv)
|
||||
{
|
||||
cout << endl
|
||||
<< "This program demonstrated the use of the discrete Fourier transform (DFT). " << endl
|
||||
<< "The dft of an image is taken and it's power spectrum is displayed." << endl
|
||||
<< "The dft of an image is taken and it's power spectrum is displayed." << endl << endl
|
||||
<< "Usage:" << endl
|
||||
<< "./discrete_fourier_transform [image_name -- default ../data/lena.jpg]" << endl;
|
||||
<< argv[0] << " [image_name -- default lena.jpg]" << endl << endl;
|
||||
}
|
||||
|
||||
int main(int argc, char ** argv)
|
||||
{
|
||||
help();
|
||||
help(argv);
|
||||
|
||||
const char* filename = argc >=2 ? argv[1] : "../data/lena.jpg";
|
||||
const char* filename = argc >=2 ? argv[1] : "lena.jpg";
|
||||
|
||||
Mat I = imread(filename, IMREAD_GRAYSCALE);
|
||||
Mat I = imread( samples::findFile( filename ), IMREAD_GRAYSCALE);
|
||||
if( I.empty()){
|
||||
cout << "Error opening image" << endl;
|
||||
return -1;
|
||||
return EXIT_FAILURE;
|
||||
}
|
||||
|
||||
//! [expand]
|
||||
@@ -91,5 +91,5 @@ int main(int argc, char ** argv)
|
||||
imshow("spectrum magnitude", magI);
|
||||
waitKey();
|
||||
|
||||
return 0;
|
||||
return EXIT_SUCCESS;
|
||||
}
|
||||
|
||||
@@ -12,7 +12,7 @@ static void help(char* progName)
|
||||
<< "This program shows how to filter images with mask: the write it yourself and the"
|
||||
<< "filter2d way. " << endl
|
||||
<< "Usage:" << endl
|
||||
<< progName << " [image_path -- default ../data/lena.jpg] [G -- grayscale] " << endl << endl;
|
||||
<< progName << " [image_path -- default lena.jpg] [G -- grayscale] " << endl << endl;
|
||||
}
|
||||
|
||||
|
||||
@@ -21,19 +21,19 @@ void Sharpen(const Mat& myImage,Mat& Result);
|
||||
int main( int argc, char* argv[])
|
||||
{
|
||||
help(argv[0]);
|
||||
const char* filename = argc >=2 ? argv[1] : "../data/lena.jpg";
|
||||
const char* filename = argc >=2 ? argv[1] : "lena.jpg";
|
||||
|
||||
Mat src, dst0, dst1;
|
||||
|
||||
if (argc >= 3 && !strcmp("G", argv[2]))
|
||||
src = imread( filename, IMREAD_GRAYSCALE);
|
||||
src = imread( samples::findFile( filename ), IMREAD_GRAYSCALE);
|
||||
else
|
||||
src = imread( filename, IMREAD_COLOR);
|
||||
src = imread( samples::findFile( filename ), IMREAD_COLOR);
|
||||
|
||||
if (src.empty())
|
||||
{
|
||||
cerr << "Can't open image [" << filename << "]" << endl;
|
||||
return -1;
|
||||
return EXIT_FAILURE;
|
||||
}
|
||||
|
||||
namedWindow("Input", WINDOW_AUTOSIZE);
|
||||
@@ -67,7 +67,7 @@ int main( int argc, char* argv[])
|
||||
imshow( "Output", dst1 );
|
||||
|
||||
waitKey();
|
||||
return 0;
|
||||
return EXIT_SUCCESS;
|
||||
}
|
||||
//! [basic_method]
|
||||
void Sharpen(const Mat& myImage,Mat& Result)
|
||||
|
||||
Reference in New Issue
Block a user