Merge pull request #3217 from avdmitry:samples_cpp_data
@@ -44,8 +44,8 @@ static void on_trackbar( int, void* )
|
||||
int main( void )
|
||||
{
|
||||
/// Read image ( same size, same type )
|
||||
src1 = imread("../images/LinuxLogo.jpg");
|
||||
src2 = imread("../images/WindowsLogo.jpg");
|
||||
src1 = imread("../data/LinuxLogo.jpg");
|
||||
src2 = imread("../data/WindowsLogo.jpg");
|
||||
|
||||
if( src1.empty() ) { printf("Error loading src1 \n"); return -1; }
|
||||
if( src2.empty() ) { printf("Error loading src2 \n"); return -1; }
|
||||
|
@@ -32,8 +32,8 @@ int main( void )
|
||||
{ alpha = input; }
|
||||
|
||||
/// Read image ( same size, same type )
|
||||
src1 = imread("../images/LinuxLogo.jpg");
|
||||
src2 = imread("../images/WindowsLogo.jpg");
|
||||
src1 = imread("../data/LinuxLogo.jpg");
|
||||
src2 = imread("../data/WindowsLogo.jpg");
|
||||
|
||||
if( src1.empty() ) { std::cout<< "Error loading src1"<<std::endl; return -1; }
|
||||
if( src2.empty() ) { std::cout<< "Error loading src2"<<std::endl; return -1; }
|
||||
|
@@ -32,7 +32,7 @@ int main( void )
|
||||
printf( " * [ESC] -> Close program \n \n" );
|
||||
|
||||
/// Test image - Make sure it s divisible by 2^{n}
|
||||
src = imread( "../images/chicky_512.png" );
|
||||
src = imread( "../data/chicky_512.png" );
|
||||
if( src.empty() )
|
||||
{ printf(" No data! -- Exiting the program \n");
|
||||
return -1; }
|
||||
|
@@ -35,7 +35,7 @@ int main( void )
|
||||
namedWindow( window_name, WINDOW_AUTOSIZE );
|
||||
|
||||
/// Load the source image
|
||||
src = imread( "../images/lena.png", 1 );
|
||||
src = imread( "../data/lena.jpg", 1 );
|
||||
|
||||
if( display_caption( "Original Image" ) != 0 ) { return 0; }
|
||||
|
||||
|
@@ -14,14 +14,14 @@ static void help(char* progName)
|
||||
<< "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
|
||||
<< "Usage:" << endl
|
||||
<< progName << " [image_name -- default lena.jpg] " << endl << endl;
|
||||
<< progName << " [image_name -- default ../data/lena.jpg] " << endl << endl;
|
||||
}
|
||||
|
||||
int main(int argc, char ** argv)
|
||||
{
|
||||
help(argv[0]);
|
||||
|
||||
const char* filename = argc >=2 ? argv[1] : "lena.jpg";
|
||||
const char* filename = argc >=2 ? argv[1] : "../data/lena.jpg";
|
||||
|
||||
Mat I = imread(filename, IMREAD_GRAYSCALE);
|
||||
if( I.empty())
|
||||
|
@@ -80,7 +80,7 @@ int main(int ac, char** av)
|
||||
|
||||
fs << "iterationNr" << 100;
|
||||
fs << "strings" << "["; // text - string sequence
|
||||
fs << "image1.jpg" << "Awesomeness" << "baboon.jpg";
|
||||
fs << "image1.jpg" << "Awesomeness" << "../data/baboon.jpg";
|
||||
fs << "]"; // close sequence
|
||||
|
||||
fs << "Mapping"; // text - mapping
|
||||
|
@@ -17,7 +17,7 @@ static void help( char* progName)
|
||||
<< "Also contains example for image read, spliting the planes, merging back and " << endl
|
||||
<< " color conversion, plus iterating through pixels. " << endl
|
||||
<< "Usage:" << endl
|
||||
<< progName << " [image-name Default: lena.jpg]" << endl << endl;
|
||||
<< progName << " [image-name Default: ../data/lena.jpg]" << endl << endl;
|
||||
}
|
||||
|
||||
// comment out the define to use only the latest C++ API
|
||||
@@ -31,7 +31,7 @@ static void help( char* progName)
|
||||
int main( int argc, char** argv )
|
||||
{
|
||||
help(argv[0]);
|
||||
const char* imagename = argc > 1 ? argv[1] : "lena.jpg";
|
||||
const char* imagename = argc > 1 ? argv[1] : "../data/lena.jpg";
|
||||
|
||||
#ifdef DEMO_MIXED_API_USE
|
||||
Ptr<IplImage> IplI(cvLoadImage(imagename)); // Ptr<T> is a safe ref-counting pointer class
|
||||
|
@@ -36,7 +36,7 @@ static void help()
|
||||
const char* keys =
|
||||
{
|
||||
"{c camera | | use camera or not}"
|
||||
"{fn file_name|baboon.jpg | image file }"
|
||||
"{fn file_name|../data/baboon.jpg | image file }"
|
||||
"{a accel |auto | accelerator type: auto (default), cpu, gpu}"
|
||||
};
|
||||
|
||||
|
@@ -14,7 +14,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_name -- default lena.jpg] [G -- grayscale] " << endl << endl;
|
||||
<< progName << " [image_name -- default ../data/lena.jpg] [G -- grayscale] " << endl << endl;
|
||||
}
|
||||
|
||||
|
||||
@@ -23,7 +23,7 @@ void Sharpen(const Mat& myImage,Mat& Result);
|
||||
int main( int argc, char* argv[])
|
||||
{
|
||||
help(argv[0]);
|
||||
const char* filename = argc >=2 ? argv[1] : "lena.jpg";
|
||||
const char* filename = argc >=2 ? argv[1] : "../data/lena.jpg";
|
||||
|
||||
Mat I, J, K;
|
||||
|
||||
|
@@ -12,11 +12,11 @@ const float nn_match_ratio = 0.8f; // Nearest neighbor matching ratio
|
||||
|
||||
int main(void)
|
||||
{
|
||||
Mat img1 = imread("graf1.png", IMREAD_GRAYSCALE);
|
||||
Mat img2 = imread("graf3.png", IMREAD_GRAYSCALE);
|
||||
Mat img1 = imread("../data/graf1.png", IMREAD_GRAYSCALE);
|
||||
Mat img2 = imread("../data/graf3.png", IMREAD_GRAYSCALE);
|
||||
|
||||
Mat homography;
|
||||
FileStorage fs("H1to3p.xml", FileStorage::READ);
|
||||
FileStorage fs("../data/H1to3p.xml", FileStorage::READ);
|
||||
fs.getFirstTopLevelNode() >> homography;
|
||||
|
||||
vector<KeyPoint> kpts1, kpts2;
|
||||
|
Before Width: | Height: | Size: 8.1 KiB |
Before Width: | Height: | Size: 6.8 KiB |
Before Width: | Height: | Size: 230 KiB |
Before Width: | Height: | Size: 282 KiB |
Before Width: | Height: | Size: 11 KiB |
Before Width: | Height: | Size: 176 KiB |
Before Width: | Height: | Size: 64 KiB |
Before Width: | Height: | Size: 546 KiB |
Before Width: | Height: | Size: 52 KiB |
Before Width: | Height: | Size: 16 KiB |
Before Width: | Height: | Size: 11 KiB |
Before Width: | Height: | Size: 37 KiB |
Before Width: | Height: | Size: 60 KiB |
Before Width: | Height: | Size: 463 KiB |
Before Width: | Height: | Size: 14 KiB |
Before Width: | Height: | Size: 30 KiB |
@@ -1,21 +1,23 @@
|
||||
#include <opencv2/core/core.hpp>
|
||||
#include <opencv2/imgcodecs.hpp>
|
||||
#include <opencv2/highgui/highgui.hpp>
|
||||
|
||||
#include <iostream>
|
||||
#include <string>
|
||||
|
||||
using namespace cv;
|
||||
using namespace std;
|
||||
|
||||
int main( int argc, char** argv )
|
||||
{
|
||||
if( argc != 2)
|
||||
string imageName("../data/HappyFish.jpg"); // by default
|
||||
if( argc > 1)
|
||||
{
|
||||
cout <<" Usage: display_image ImageToLoadAndDisplay" << endl;
|
||||
return -1;
|
||||
imageName = argv[1];
|
||||
}
|
||||
|
||||
Mat image;
|
||||
image = imread(argv[1], IMREAD_COLOR); // Read the file
|
||||
image = imread(imageName.c_str(), IMREAD_COLOR); // Read the file
|
||||
|
||||
if( image.empty() ) // Check for invalid input
|
||||
{
|
||||
|