Skip to content

Commit

Permalink
initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
avdmitry committed Sep 23, 2014
1 parent cff5e3e commit 1007c06
Show file tree
Hide file tree
Showing 159 changed files with 118 additions and 5,119 deletions.
Binary file removed samples/cpp/airplane.jpg
Binary file not shown.
Binary file removed samples/cpp/baboon200.jpg
Binary file not shown.
Binary file removed samples/cpp/baboon200_rotated.jpg
Binary file not shown.
2 changes: 1 addition & 1 deletion samples/cpp/bgfg_segm.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ const char* keys =
"{c camera | | use camera or not}"
"{m method |mog2 | method (knn or mog2) }"
"{s smooth | | smooth the mask }"
"{fn file_name|tree.avi | movie file }"
"{fn file_name|../data/tree.avi | movie file }"
};

//this is a sample for foreground detection functions
Expand Down
4 changes: 2 additions & 2 deletions samples/cpp/connected_components.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -36,14 +36,14 @@ static void help()
{
cout << "\n This program demonstrates connected components and use of the trackbar\n"
"Usage: \n"
" ./connected_components <image(stuff.jpg as default)>\n"
" ./connected_components <image(../data/stuff.jpg as default)>\n"
"The image is converted to grayscale and displayed, another image has a trackbar\n"
"that controls thresholding and thereby the extracted contours which are drawn in color\n";
}

const char* keys =
{
"{@image|stuff.jpg|image for converting to a grayscale}"
"{@image|../data/stuff.jpg|image for converting to a grayscale}"
};

int main( int argc, const char** argv )
Expand Down
4 changes: 2 additions & 2 deletions samples/cpp/demhist.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -59,12 +59,12 @@ static void updateBrightnessContrast( int /*arg*/, void* )
static void help()
{
std::cout << "\nThis program demonstrates the use of calcHist() -- histogram creation.\n"
<< "Usage: \n" << "demhist [image_name -- Defaults to baboon.jpg]" << std::endl;
<< "Usage: \n" << "demhist [image_name -- Defaults to ../data/baboon.jpg]" << std::endl;
}

const char* keys =
{
"{@image|baboon.jpg|input image file}"
"{@image|../data/baboon.jpg|input image file}"
};

int main( int argc, const char** argv )
Expand Down
4 changes: 2 additions & 2 deletions samples/cpp/dft.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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 lena.jpg]\n");
"./dft [image_name -- default ../data/lena.jpg]\n");
}

const char* keys =
{
"{@image|lena.jpg|input image file}"
"{@image|../data/lena.jpg|input image file}"
};

int main(int argc, const char ** argv)
Expand Down
4 changes: 2 additions & 2 deletions samples/cpp/distrans.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ static void help()
{
printf("\nProgram to demonstrate the use of the distance transform function between edge images.\n"
"Usage:\n"
"./distrans [image_name -- default image is stuff.jpg]\n"
"./distrans [image_name -- default image is ../data/stuff.jpg]\n"
"\nHot keys: \n"
"\tESC - quit the program\n"
"\tC - use C/Inf metric\n"
Expand All @@ -107,7 +107,7 @@ static void help()

const char* keys =
{
"{@image |stuff.jpg|input image file}"
"{@image |../data/stuff.jpg|input image file}"
};

int main( int argc, const char** argv )
Expand Down
4 changes: 2 additions & 2 deletions samples/cpp/edge.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,12 +28,12 @@ static void help()
{
printf("\nThis sample demonstrates Canny edge detection\n"
"Call:\n"
" /.edge [image_name -- Default is fruits.jpg]\n\n");
" /.edge [image_name -- Default is ../data/fruits.jpg]\n\n");
}

const char* keys =
{
"{@image |fruits.jpg|input image name}"
"{@image |../data/fruits.jpg|input image name}"
};

int main( int argc, const char** argv )
Expand Down
4 changes: 2 additions & 2 deletions samples/cpp/facedetect.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -118,8 +118,8 @@ int main( int argc, const char** argv )
}
else
{
image = imread( "lena.jpg", 1 );
if(image.empty()) cout << "Couldn't read lena.jpg" << endl;
image = imread( "../data/lena.jpg", 1 );
if(image.empty()) cout << "Couldn't read ../data/lena.jpg" << endl;
}

cvNamedWindow( "result", 1 );
Expand Down
4 changes: 2 additions & 2 deletions samples/cpp/ffilldemo.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ static void help()
{
cout << "\nThis program demonstrated the floodFill() function\n"
"Call:\n"
"./ffilldemo [image_name -- Default: fruits.jpg]\n" << endl;
"./ffilldemo [image_name -- Default: ../data/fruits.jpg]\n" << endl;

cout << "Hot keys: \n"
"\tESC - quit the program\n"
Expand Down Expand Up @@ -73,7 +73,7 @@ static void onMouse( int event, int x, int y, int, void* )

int main( int argc, char** argv )
{
char* filename = argc >= 2 ? argv[1] : (char*)"fruits.jpg";
char* filename = argc >= 2 ? argv[1] : (char*)"../data/fruits.jpg";
image0 = imread(filename, 1);

if( image0.empty() )
Expand Down
4 changes: 2 additions & 2 deletions samples/cpp/filestorage.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -85,8 +85,8 @@ int main(int ac, char** av)
cout << "writing images\n";
fs << "images" << "[";

fs << "image1.jpg" << "myfi.png" << "baboon.jpg";
cout << "image1.jpg" << " myfi.png" << " baboon.jpg" << endl;
fs << "image1.jpg" << "myfi.png" << "../data/baboon.jpg";
cout << "image1.jpg" << " myfi.png" << " ../data/baboon.jpg" << endl;

fs << "]";

Expand Down
4 changes: 2 additions & 2 deletions samples/cpp/fitellipse.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ using namespace std;
// "\nThis program is demonstration for ellipse fitting. The program finds\n"
// "contours and approximate it by ellipses.\n"
// "Call:\n"
// "./fitellipse [image_name -- Default stuff.jpg]\n" << endl;
// "./fitellipse [image_name -- Default ../data/stuff.jpg]\n" << endl;
// }

int sliderPos = 70;
Expand All @@ -38,7 +38,7 @@ void processImage(int, void*);

int main( int argc, char** argv )
{
const char* filename = argc == 2 ? argv[1] : (char*)"stuff.jpg";
const char* filename = argc == 2 ? argv[1] : (char*)"../data/stuff.jpg";
image = imread(filename, 0);
if( image.empty() )
{
Expand Down
4 changes: 2 additions & 2 deletions samples/cpp/houghcircles.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,12 @@ static void help()
{
cout << "\nThis program demonstrates circle finding with the Hough transform.\n"
"Usage:\n"
"./houghcircles <image_name>, Default is pic1.png\n" << endl;
"./houghcircles <image_name>, Default is ../data/board.jpg\n" << endl;
}

int main(int argc, char** argv)
{
const char* filename = argc >= 2 ? argv[1] : "board.jpg";
const char* filename = argc >= 2 ? argv[1] : "../data/board.jpg";

Mat img = imread(filename, 0);
if(img.empty())
Expand Down
4 changes: 2 additions & 2 deletions samples/cpp/houghlines.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,12 @@ static void help()
{
cout << "\nThis program demonstrates line finding with the Hough transform.\n"
"Usage:\n"
"./houghlines <image_name>, Default is pic1.png\n" << endl;
"./houghlines <image_name>, Default is ../data/pic1.png\n" << endl;
}

int main(int argc, char** argv)
{
const char* filename = argc >= 2 ? argv[1] : "pic1.png";
const char* filename = argc >= 2 ? argv[1] : "../data/pic1.png";

Mat src = imread(filename, 0);
if(src.empty())
Expand Down
4 changes: 2 additions & 2 deletions samples/cpp/image.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ static void help()
"It shows reading of images, converting to planes and merging back, color conversion\n"
"and also iterating through pixels.\n"
"Call:\n"
"./image [image-name Default: lena.jpg]\n" << endl;
"./image [image-name Default: ../data/lena.jpg]\n" << endl;
}

// enable/disable use of mixed API in the code below.
Expand All @@ -28,7 +28,7 @@ static void help()
int main( int argc, char** argv )
{
help();
const char* imagename = argc > 1 ? argv[1] : "lena.jpg";
const char* imagename = argc > 1 ? argv[1] : "../data/lena.jpg";
#if DEMO_MIXED_API_USE
Ptr<IplImage> iplimg(cvLoadImage(imagename)); // Ptr<T> is safe ref-counting pointer class
if(!iplimg)
Expand Down
6 changes: 3 additions & 3 deletions samples/cpp/image_alignment.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
* findTransformECC that implements the image alignment ECC algorithm
*
*
* The demo loads an image (defaults to fruits.jpg) and it artificially creates
* The demo loads an image (defaults to ../data/fruits.jpg) and it artificially creates
* a template image based on the given motion type. When two images are given,
* the first image is the input image and the second one defines the template image.
* In the latter case, you can also parse the warp's initialization.
Expand Down Expand Up @@ -44,7 +44,7 @@ static void draw_warped_roi(Mat& image, const int width, const int height, Mat&


const std::string keys =
"{@inputImage | fruits.jpg | input image filename }"
"{@inputImage | ../data/fruits.jpg | input image filename }"
"{@templateImage | | template image filename (optional)}"
"{@inputWarp | | input warp (matrix) filename (optional)}"
"{n numOfIter | 50 | ECC's iterations }"
Expand All @@ -64,7 +64,7 @@ static void help(void)
" are given, the initialization of the warp by command line parsing is possible. "
"If inputWarp is missing, the identity transformation initializes the algorithm. \n" << endl;

cout << "\nUsage example (one image): \n./ecc fruits.jpg -o=outWarp.ecc "
cout << "\nUsage example (one image): \n./ecc ../data/fruits.jpg -o=outWarp.ecc "
"-m=euclidean -e=1e-6 -N=70 -v=1 \n" << endl;

cout << "\nUsage example (two images with initialization): \n./ecc yourInput.png yourTemplate.png "
Expand Down
4 changes: 2 additions & 2 deletions samples/cpp/inpaint.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ static void help()
<< "with surrounding image areas.\n"
"Using OpenCV version %s\n" << CV_VERSION << "\n"
"Usage:\n"
"./inpaint [image_name -- Default fruits.jpg]\n" << endl;
"./inpaint [image_name -- Default ../data/fruits.jpg]\n" << endl;

cout << "Hot keys: \n"
"\tESC - quit the program\n"
Expand Down Expand Up @@ -47,7 +47,7 @@ static void onMouse( int event, int x, int y, int flags, void* )

int main( int argc, char** argv )
{
char* filename = argc >= 2 ? argv[1] : (char*)"fruits.jpg";
char* filename = argc >= 2 ? argv[1] : (char*)"../data/fruits.jpg";
Mat img0 = imread(filename, -1);
if(img0.empty())
{
Expand Down
2 changes: 1 addition & 1 deletion samples/cpp/letter_recog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -489,7 +489,7 @@ int main( int argc, char *argv[] )
{
string filename_to_save = "";
string filename_to_load = "";
string data_filename = "./letter-recognition.data";
string data_filename = "../data/letter-recognition.data";
int method = 0;

int i;
Expand Down
2 changes: 1 addition & 1 deletion samples/cpp/logistic_regression.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ static float calculateAccuracyPercent(const Mat &original, const Mat &predicted)

int main()
{
const String filename = "data01.xml";
const String filename = "../data/data01.xml";
cout << "**********************************************************************" << endl;
cout << filename
<< " contains digits 0 and 1 of 20 samples each, collected on an Android device" << endl;
Expand Down
Binary file removed samples/cpp/logo.png
Binary file not shown.
Binary file removed samples/cpp/logo_in_clutter.png
Binary file not shown.
4 changes: 2 additions & 2 deletions samples/cpp/lsd_lines.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ int main(int argc, char** argv)
std::string in;
if (argc != 2)
{
std::cout << "Usage: lsd_lines [input image]. Now loading building.jpg" << std::endl;
in = "building.jpg";
std::cout << "Usage: lsd_lines [input image]. Now loading ../data/building.jpg" << std::endl;
in = "../data/building.jpg";
}
else
{
Expand Down
Binary file removed samples/cpp/memorial.exr
Binary file not shown.
2 changes: 1 addition & 1 deletion samples/cpp/morphology2.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ static void ErodeDilate(int, void*)

int main( int argc, char** argv )
{
char* filename = argc == 2 ? argv[1] : (char*)"baboon.jpg";
char* filename = argc == 2 ? argv[1] : (char*)"../data/baboon.jpg";
if( (src = imread(filename,1)).empty() )
return -1;

Expand Down
Binary file removed samples/cpp/puzzle.png
Binary file not shown.
Binary file removed samples/cpp/scene_l.bmp
Binary file not shown.
Binary file removed samples/cpp/scene_r.bmp
Binary file not shown.
4 changes: 2 additions & 2 deletions samples/cpp/shape_example.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ static void help()
{
printf("\n"
"This program demonstrates a method for shape comparisson based on Shape Context\n"
"You should run the program providing a number between 1 and 20 for selecting an image in the folder shape_sample.\n"
"You should run the program providing a number between 1 and 20 for selecting an image in the folder ../data/shape_sample.\n"
"Call\n"
"./shape_example [number between 1 and 20]\n\n");
}
Expand Down Expand Up @@ -55,7 +55,7 @@ static vector<Point> simpleContour( const Mat& currentQuery, int n=300 )
int main(int argc, char** argv)
{
help();
string path = "./shape_sample/";
string path = "../data/shape_sample/";
int indexQuery = 1;
if( argc < 2 )
{
Expand Down
4 changes: 2 additions & 2 deletions samples/cpp/squares.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -142,8 +142,8 @@ static void drawSquares( Mat& image, const vector<vector<Point> >& squares )

int main(int /*argc*/, char** /*argv*/)
{
static const char* names[] = { "pic1.png", "pic2.png", "pic3.png",
"pic4.png", "pic5.png", "pic6.png", 0 };
static const char* names[] = { "../data/pic1.png", "../data/pic2.png", "../data/pic3.png",
"../data/pic4.png", "../data/pic5.png", "../data/pic6.png", 0 };
help();
namedWindow( wndname, 1 );
vector<vector<Point> > squares;
Expand Down
4 changes: 2 additions & 2 deletions samples/cpp/stereo_calib.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,7 @@ StereoCalib(const vector<string>& imagelist, Size boardSize, bool useCalibrated=
cout << "average reprojection err = " << err/npoints << endl;

// save intrinsic parameters
FileStorage fs("intrinsics.yml", FileStorage::WRITE);
FileStorage fs("../data/intrinsics.yml", FileStorage::WRITE);
if( fs.isOpened() )
{
fs << "M1" << cameraMatrix[0] << "D1" << distCoeffs[0] <<
Expand Down Expand Up @@ -382,7 +382,7 @@ int main(int argc, char** argv)

if( imagelistfn == "" )
{
imagelistfn = "stereo_calib.xml";
imagelistfn = "../data/stereo_calib.xml";
boardSize = Size(9, 6);
}
else if( boardSize.width <= 0 || boardSize.height <= 0 )
Expand Down
Binary file removed samples/cpp/tsukuba_l.png
Binary file not shown.
Binary file removed samples/cpp/tsukuba_r.png
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -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())
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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}"
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}


Expand All @@ -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;

Expand Down
Loading

0 comments on commit 1007c06

Please sign in to comment.