Commit 1007c06d authored by Dmitriy Anisimov's avatar Dmitriy Anisimov

initial commit

parent cff5e3ee
...@@ -23,7 +23,7 @@ const char* keys = ...@@ -23,7 +23,7 @@ const char* keys =
"{c camera | | use camera or not}" "{c camera | | use camera or not}"
"{m method |mog2 | method (knn or mog2) }" "{m method |mog2 | method (knn or mog2) }"
"{s smooth | | smooth the mask }" "{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 //this is a sample for foreground detection functions
......
...@@ -36,14 +36,14 @@ static void help() ...@@ -36,14 +36,14 @@ static void help()
{ {
cout << "\n This program demonstrates connected components and use of the trackbar\n" cout << "\n This program demonstrates connected components and use of the trackbar\n"
"Usage: \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" "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"; "that controls thresholding and thereby the extracted contours which are drawn in color\n";
} }
const char* keys = 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 ) int main( int argc, const char** argv )
......
...@@ -59,12 +59,12 @@ static void updateBrightnessContrast( int /*arg*/, void* ) ...@@ -59,12 +59,12 @@ static void updateBrightnessContrast( int /*arg*/, void* )
static void help() static void help()
{ {
std::cout << "\nThis program demonstrates the use of calcHist() -- histogram creation.\n" 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 = const char* keys =
{ {
"{@image|baboon.jpg|input image file}" "{@image|../data/baboon.jpg|input image file}"
}; };
int main( int argc, const char** argv ) int main( int argc, const char** argv )
......
...@@ -14,12 +14,12 @@ static void help() ...@@ -14,12 +14,12 @@ static void help()
printf("\nThis program demonstrated the use of the discrete Fourier transform (dft)\n" 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" "The dft of an image is taken and it's power spectrum is displayed.\n"
"Usage:\n" "Usage:\n"
"./dft [image_name -- default lena.jpg]\n"); "./dft [image_name -- default ../data/lena.jpg]\n");
} }
const char* keys = const char* keys =
{ {
"{@image|lena.jpg|input image file}" "{@image|../data/lena.jpg|input image file}"
}; };
int main(int argc, const char ** argv) int main(int argc, const char ** argv)
......
...@@ -91,7 +91,7 @@ static void help() ...@@ -91,7 +91,7 @@ static void help()
{ {
printf("\nProgram to demonstrate the use of the distance transform function between edge images.\n" printf("\nProgram to demonstrate the use of the distance transform function between edge images.\n"
"Usage:\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" "\nHot keys: \n"
"\tESC - quit the program\n" "\tESC - quit the program\n"
"\tC - use C/Inf metric\n" "\tC - use C/Inf metric\n"
...@@ -107,7 +107,7 @@ static void help() ...@@ -107,7 +107,7 @@ static void help()
const char* keys = const char* keys =
{ {
"{@image |stuff.jpg|input image file}" "{@image |../data/stuff.jpg|input image file}"
}; };
int main( int argc, const char** argv ) int main( int argc, const char** argv )
......
...@@ -28,12 +28,12 @@ static void help() ...@@ -28,12 +28,12 @@ static void help()
{ {
printf("\nThis sample demonstrates Canny edge detection\n" printf("\nThis sample demonstrates Canny edge detection\n"
"Call:\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 = const char* keys =
{ {
"{@image |fruits.jpg|input image name}" "{@image |../data/fruits.jpg|input image name}"
}; };
int main( int argc, const char** argv ) int main( int argc, const char** argv )
......
...@@ -118,8 +118,8 @@ int main( int argc, const char** argv ) ...@@ -118,8 +118,8 @@ int main( int argc, const char** argv )
} }
else else
{ {
image = imread( "lena.jpg", 1 ); image = imread( "../data/lena.jpg", 1 );
if(image.empty()) cout << "Couldn't read lena.jpg" << endl; if(image.empty()) cout << "Couldn't read ../data/lena.jpg" << endl;
} }
cvNamedWindow( "result", 1 ); cvNamedWindow( "result", 1 );
......
...@@ -12,7 +12,7 @@ static void help() ...@@ -12,7 +12,7 @@ static void help()
{ {
cout << "\nThis program demonstrated the floodFill() function\n" cout << "\nThis program demonstrated the floodFill() function\n"
"Call:\n" "Call:\n"
"./ffilldemo [image_name -- Default: fruits.jpg]\n" << endl; "./ffilldemo [image_name -- Default: ../data/fruits.jpg]\n" << endl;
cout << "Hot keys: \n" cout << "Hot keys: \n"
"\tESC - quit the program\n" "\tESC - quit the program\n"
...@@ -73,7 +73,7 @@ static void onMouse( int event, int x, int y, int, void* ) ...@@ -73,7 +73,7 @@ static void onMouse( int event, int x, int y, int, void* )
int main( int argc, char** argv ) 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); image0 = imread(filename, 1);
if( image0.empty() ) if( image0.empty() )
......
...@@ -85,8 +85,8 @@ int main(int ac, char** av) ...@@ -85,8 +85,8 @@ int main(int ac, char** av)
cout << "writing images\n"; cout << "writing images\n";
fs << "images" << "["; fs << "images" << "[";
fs << "image1.jpg" << "myfi.png" << "baboon.jpg"; fs << "image1.jpg" << "myfi.png" << "../data/baboon.jpg";
cout << "image1.jpg" << " myfi.png" << " baboon.jpg" << endl; cout << "image1.jpg" << " myfi.png" << " ../data/baboon.jpg" << endl;
fs << "]"; fs << "]";
......
...@@ -27,7 +27,7 @@ using namespace std; ...@@ -27,7 +27,7 @@ using namespace std;
// "\nThis program is demonstration for ellipse fitting. The program finds\n" // "\nThis program is demonstration for ellipse fitting. The program finds\n"
// "contours and approximate it by ellipses.\n" // "contours and approximate it by ellipses.\n"
// "Call:\n" // "Call:\n"
// "./fitellipse [image_name -- Default stuff.jpg]\n" << endl; // "./fitellipse [image_name -- Default ../data/stuff.jpg]\n" << endl;
// } // }
int sliderPos = 70; int sliderPos = 70;
...@@ -38,7 +38,7 @@ void processImage(int, void*); ...@@ -38,7 +38,7 @@ void processImage(int, void*);
int main( int argc, char** argv ) 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); image = imread(filename, 0);
if( image.empty() ) if( image.empty() )
{ {
......
...@@ -11,12 +11,12 @@ static void help() ...@@ -11,12 +11,12 @@ static void help()
{ {
cout << "\nThis program demonstrates circle finding with the Hough transform.\n" cout << "\nThis program demonstrates circle finding with the Hough transform.\n"
"Usage:\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) 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); Mat img = imread(filename, 0);
if(img.empty()) if(img.empty())
......
...@@ -11,12 +11,12 @@ static void help() ...@@ -11,12 +11,12 @@ static void help()
{ {
cout << "\nThis program demonstrates line finding with the Hough transform.\n" cout << "\nThis program demonstrates line finding with the Hough transform.\n"
"Usage:\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) 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); Mat src = imread(filename, 0);
if(src.empty()) if(src.empty())
......
...@@ -14,7 +14,7 @@ static void help() ...@@ -14,7 +14,7 @@ static void help()
"It shows reading of images, converting to planes and merging back, color conversion\n" "It shows reading of images, converting to planes and merging back, color conversion\n"
"and also iterating through pixels.\n" "and also iterating through pixels.\n"
"Call:\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. // enable/disable use of mixed API in the code below.
...@@ -28,7 +28,7 @@ static void help() ...@@ -28,7 +28,7 @@ static void help()
int main( int argc, char** argv ) int main( int argc, char** argv )
{ {
help(); 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 #if DEMO_MIXED_API_USE
Ptr<IplImage> iplimg(cvLoadImage(imagename)); // Ptr<T> is safe ref-counting pointer class Ptr<IplImage> iplimg(cvLoadImage(imagename)); // Ptr<T> is safe ref-counting pointer class
if(!iplimg) if(!iplimg)
......
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
* findTransformECC that implements the image alignment ECC algorithm * 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, * 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. * 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. * In the latter case, you can also parse the warp's initialization.
...@@ -44,7 +44,7 @@ static void draw_warped_roi(Mat& image, const int width, const int height, Mat& ...@@ -44,7 +44,7 @@ static void draw_warped_roi(Mat& image, const int width, const int height, Mat&
const std::string keys = const std::string keys =
"{@inputImage | fruits.jpg | input image filename }" "{@inputImage | ../data/fruits.jpg | input image filename }"
"{@templateImage | | template image filename (optional)}" "{@templateImage | | template image filename (optional)}"
"{@inputWarp | | input warp (matrix) filename (optional)}" "{@inputWarp | | input warp (matrix) filename (optional)}"
"{n numOfIter | 50 | ECC's iterations }" "{n numOfIter | 50 | ECC's iterations }"
...@@ -64,7 +64,7 @@ static void help(void) ...@@ -64,7 +64,7 @@ static void help(void)
" are given, the initialization of the warp by command line parsing is possible. " " 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; "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; "-m=euclidean -e=1e-6 -N=70 -v=1 \n" << endl;
cout << "\nUsage example (two images with initialization): \n./ecc yourInput.png yourTemplate.png " cout << "\nUsage example (two images with initialization): \n./ecc yourInput.png yourTemplate.png "
......
...@@ -14,7 +14,7 @@ static void help() ...@@ -14,7 +14,7 @@ static void help()
<< "with surrounding image areas.\n" << "with surrounding image areas.\n"
"Using OpenCV version %s\n" << CV_VERSION << "\n" "Using OpenCV version %s\n" << CV_VERSION << "\n"
"Usage:\n" "Usage:\n"
"./inpaint [image_name -- Default fruits.jpg]\n" << endl; "./inpaint [image_name -- Default ../data/fruits.jpg]\n" << endl;
cout << "Hot keys: \n" cout << "Hot keys: \n"
"\tESC - quit the program\n" "\tESC - quit the program\n"
...@@ -47,7 +47,7 @@ static void onMouse( int event, int x, int y, int flags, void* ) ...@@ -47,7 +47,7 @@ static void onMouse( int event, int x, int y, int flags, void* )
int main( int argc, char** argv ) 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); Mat img0 = imread(filename, -1);
if(img0.empty()) if(img0.empty())
{ {
......
...@@ -489,7 +489,7 @@ int main( int argc, char *argv[] ) ...@@ -489,7 +489,7 @@ int main( int argc, char *argv[] )
{ {
string filename_to_save = ""; string filename_to_save = "";
string filename_to_load = ""; string filename_to_load = "";
string data_filename = "./letter-recognition.data"; string data_filename = "../data/letter-recognition.data";
int method = 0; int method = 0;
int i; int i;
......
...@@ -83,7 +83,7 @@ static float calculateAccuracyPercent(const Mat &original, const Mat &predicted) ...@@ -83,7 +83,7 @@ static float calculateAccuracyPercent(const Mat &original, const Mat &predicted)
int main() int main()
{ {
const String filename = "data01.xml"; const String filename = "../data/data01.xml";
cout << "**********************************************************************" << endl; cout << "**********************************************************************" << endl;
cout << filename cout << filename
<< " contains digits 0 and 1 of 20 samples each, collected on an Android device" << endl; << " contains digits 0 and 1 of 20 samples each, collected on an Android device" << endl;
......
...@@ -15,8 +15,8 @@ int main(int argc, char** argv) ...@@ -15,8 +15,8 @@ int main(int argc, char** argv)
std::string in; std::string in;
if (argc != 2) if (argc != 2)
{ {
std::cout << "Usage: lsd_lines [input image]. Now loading building.jpg" << std::endl; std::cout << "Usage: lsd_lines [input image]. Now loading ../data/building.jpg" << std::endl;
in = "building.jpg"; in = "../data/building.jpg";
} }
else else
{ {
......
...@@ -58,7 +58,7 @@ static void ErodeDilate(int, void*) ...@@ -58,7 +58,7 @@ static void ErodeDilate(int, void*)
int main( int argc, char** argv ) 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() ) if( (src = imread(filename,1)).empty() )
return -1; return -1;
......
...@@ -17,7 +17,7 @@ static void help() ...@@ -17,7 +17,7 @@ static void help()
{ {
printf("\n" printf("\n"
"This program demonstrates a method for shape comparisson based on Shape Context\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" "Call\n"
"./shape_example [number between 1 and 20]\n\n"); "./shape_example [number between 1 and 20]\n\n");
} }
...@@ -55,7 +55,7 @@ static vector<Point> simpleContour( const Mat& currentQuery, int n=300 ) ...@@ -55,7 +55,7 @@ static vector<Point> simpleContour( const Mat& currentQuery, int n=300 )
int main(int argc, char** argv) int main(int argc, char** argv)
{ {
help(); help();
string path = "./shape_sample/"; string path = "../data/shape_sample/";
int indexQuery = 1; int indexQuery = 1;
if( argc < 2 ) if( argc < 2 )
{ {
......
...@@ -142,8 +142,8 @@ static void drawSquares( Mat& image, const vector<vector<Point> >& squares ) ...@@ -142,8 +142,8 @@ static void drawSquares( Mat& image, const vector<vector<Point> >& squares )
int main(int /*argc*/, char** /*argv*/) int main(int /*argc*/, char** /*argv*/)
{ {
static const char* names[] = { "pic1.png", "pic2.png", "pic3.png", static const char* names[] = { "../data/pic1.png", "../data/pic2.png", "../data/pic3.png",
"pic4.png", "pic5.png", "pic6.png", 0 }; "../data/pic4.png", "../data/pic5.png", "../data/pic6.png", 0 };
help(); help();
namedWindow( wndname, 1 ); namedWindow( wndname, 1 );
vector<vector<Point> > squares; vector<vector<Point> > squares;
......
...@@ -212,7 +212,7 @@ StereoCalib(const vector<string>& imagelist, Size boardSize, bool useCalibrated= ...@@ -212,7 +212,7 @@ StereoCalib(const vector<string>& imagelist, Size boardSize, bool useCalibrated=
cout << "average reprojection err = " << err/npoints << endl; cout << "average reprojection err = " << err/npoints << endl;
// save intrinsic parameters // save intrinsic parameters
FileStorage fs("intrinsics.yml", FileStorage::WRITE); FileStorage fs("../data/intrinsics.yml", FileStorage::WRITE);
if( fs.isOpened() ) if( fs.isOpened() )
{ {
fs << "M1" << cameraMatrix[0] << "D1" << distCoeffs[0] << fs << "M1" << cameraMatrix[0] << "D1" << distCoeffs[0] <<
...@@ -382,7 +382,7 @@ int main(int argc, char** argv) ...@@ -382,7 +382,7 @@ int main(int argc, char** argv)
if( imagelistfn == "" ) if( imagelistfn == "" )
{ {
imagelistfn = "stereo_calib.xml"; imagelistfn = "../data/stereo_calib.xml";
boardSize = Size(9, 6); boardSize = Size(9, 6);
} }
else if( boardSize.width <= 0 || boardSize.height <= 0 ) else if( boardSize.width <= 0 || boardSize.height <= 0 )
......
...@@ -14,14 +14,14 @@ static void help(char* progName) ...@@ -14,14 +14,14 @@ static void help(char* progName)
<< "This program demonstrated the use of the discrete Fourier transform (DFT). " << 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
<< "Usage:" << 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) int main(int argc, char ** argv)
{ {
help(argv[0]); 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); Mat I = imread(filename, IMREAD_GRAYSCALE);
if( I.empty()) if( I.empty())
......
...@@ -80,7 +80,7 @@ int main(int ac, char** av) ...@@ -80,7 +80,7 @@ int main(int ac, char** av)
fs << "iterationNr" << 100; fs << "iterationNr" << 100;
fs << "strings" << "["; // text - string sequence fs << "strings" << "["; // text - string sequence
fs << "image1.jpg" << "Awesomeness" << "baboon.jpg"; fs << "image1.jpg" << "Awesomeness" << "../data/baboon.jpg";
fs << "]"; // close sequence fs << "]"; // close sequence
fs << "Mapping"; // text - mapping fs << "Mapping"; // text - mapping
......
...@@ -17,7 +17,7 @@ static void help( char* progName) ...@@ -17,7 +17,7 @@ static void help( char* progName)
<< "Also contains example for image read, spliting the planes, merging back and " << endl << "Also contains example for image read, spliting the planes, merging back and " << endl
<< " color conversion, plus iterating through pixels. " << endl << " color conversion, plus iterating through pixels. " << endl
<< "Usage:" << 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 // comment out the define to use only the latest C++ API
...@@ -31,7 +31,7 @@ static void help( char* progName) ...@@ -31,7 +31,7 @@ static void help( char* progName)
int main( int argc, char** argv ) int main( int argc, char** argv )
{ {
help(argv[0]); 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 #ifdef DEMO_MIXED_API_USE
Ptr<IplImage> IplI(cvLoadImage(imagename)); // Ptr<T> is a safe ref-counting pointer class Ptr<IplImage> IplI(cvLoadImage(imagename)); // Ptr<T> is a safe ref-counting pointer class
......
...@@ -36,7 +36,7 @@ static void help() ...@@ -36,7 +36,7 @@ static void help()
const char* keys = const char* keys =
{ {
"{c camera | | use camera or not}" "{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}" "{a accel |auto | accelerator type: auto (default), cpu, gpu}"
}; };
......
...@@ -14,7 +14,7 @@ static void help(char* progName) ...@@ -14,7 +14,7 @@ static void help(char* progName)
<< "This program shows how to filter images with mask: the write it yourself and the" << "This program shows how to filter images with mask: the write it yourself and the"
<< "filter2d way. " << endl << "filter2d way. " << endl
<< "Usage:" << 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); ...@@ -23,7 +23,7 @@ void Sharpen(const Mat& myImage,Mat& Result);
int main( int argc, char* argv[]) int main( int argc, char* argv[])
{ {
help(argv[0]); 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; Mat I, J, K;
......
...@@ -12,11 +12,11 @@ const float nn_match_ratio = 0.8f; // Nearest neighbor matching ratio ...@@ -12,11 +12,11 @@ const float nn_match_ratio = 0.8f; // Nearest neighbor matching ratio
int main(void) int main(void)
{ {
Mat img1 = imread("graf1.png", IMREAD_GRAYSCALE); Mat img1 = imread("../data/graf1.png", IMREAD_GRAYSCALE);
Mat img2 = imread("graf3.png", IMREAD_GRAYSCALE); Mat img2 = imread("../data/graf3.png", IMREAD_GRAYSCALE);
Mat homography; Mat homography;
FileStorage fs("H1to3p.xml", FileStorage::READ); FileStorage fs("../data/H1to3p.xml", FileStorage::READ);
fs.getFirstTopLevelNode() >> homography; fs.getFirstTopLevelNode() >> homography;
vector<KeyPoint> kpts1, kpts2; vector<KeyPoint> kpts1, kpts2;
......
...@@ -111,7 +111,7 @@ int main( int argc, const char** argv ) ...@@ -111,7 +111,7 @@ int main( int argc, const char** argv )
else else
{ {
if( inputName.empty() ) if( inputName.empty() )
inputName = "lena.jpg"; inputName = "../data/lena.jpg";
image = imread( inputName, 1 ).getUMat(ACCESS_READ); image = imread( inputName, 1 ).getUMat(ACCESS_READ);
if( image.empty() ) if( image.empty() )
{ {
......
...@@ -13,7 +13,7 @@ static void help() ...@@ -13,7 +13,7 @@ static void help()
{ {
cout << "\nThis program demonstrates the famous watershed segmentation algorithm in OpenCV: watershed()\n" cout << "\nThis program demonstrates the famous watershed segmentation algorithm in OpenCV: watershed()\n"
"Usage:\n" "Usage:\n"
"./watershed [image_name -- default is fruits.jpg]\n" << endl; "./watershed [image_name -- default is ../data/fruits.jpg]\n" << endl;
cout << "Hot keys: \n" cout << "Hot keys: \n"
...@@ -48,7 +48,7 @@ static void onMouse( int event, int x, int y, int flags, void* ) ...@@ -48,7 +48,7 @@ static void onMouse( int event, int x, int y, int flags, void* )
int main( int argc, char** argv ) 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), imgGray; Mat img0 = imread(filename, 1), imgGray;
if( img0.empty() ) if( img0.empty() )
......
This source diff could not be displayed because it is too large. You can view the blob instead.
...@@ -29,4 +29,3 @@ ...@@ -29,4 +29,3 @@
"right14.jpg" "right14.jpg"
</imagelist> </imagelist>
</opencv_storage> </opencv_storage>
...@@ -23,7 +23,7 @@ int main(int argc, const char** argv) ...@@ -23,7 +23,7 @@ int main(int argc, const char** argv)
{ {
cv::CommandLineParser cmd(argc, argv, cv::CommandLineParser cmd(argc, argv,
"{ c camera | | use camera }" "{ c camera | | use camera }"
"{ f file | 768x576.avi | input video file }" "{ f file | ../data/768x576.avi | input video file }"
"{ m method | mog | method (mog, mog2, gmg, fgd) }" "{ m method | mog | method (mog, mog2, gmg, fgd) }"
"{ h help | | print help message }"); "{ h help | | print help message }");
......
...@@ -27,7 +27,7 @@ static Mat loadImage(const string& name) ...@@ -27,7 +27,7 @@ static Mat loadImage(const string& name)
int main(int argc, const char* argv[]) int main(int argc, const char* argv[])
{ {
CommandLineParser cmd(argc, argv, CommandLineParser cmd(argc, argv,
"{ image i | pic1.png | input image }" "{ image i | ../data/pic1.png | input image }"
"{ template t | templ.png | template image }" "{ template t | templ.png | template image }"
"{ full | | estimate scale and rotation }" "{ full | | estimate scale and rotation }"
"{ gpu | | use gpu version }" "{ gpu | | use gpu version }"
......
...@@ -15,12 +15,12 @@ static void help() ...@@ -15,12 +15,12 @@ static void help()
{ {
cout << "This program demonstrates line finding with the Hough transform." << endl; cout << "This program demonstrates line finding with the Hough transform." << endl;
cout << "Usage:" << endl; cout << "Usage:" << endl;
cout << "./gpu-example-houghlines <image_name>, Default is pic1.png\n" << endl; cout << "./gpu-example-houghlines <image_name>, Default is ../data/pic1.png\n" << endl;
} }
int main(int argc, const char* argv[]) int main(int argc, const char* argv[])
{ {
const string filename = argc >= 2 ? argv[1] : "pic1.png"; const string filename = argc >= 2 ? argv[1] : "../data/pic1.png";
Mat src = imread(filename, IMREAD_GRAYSCALE); Mat src = imread(filename, IMREAD_GRAYSCALE);
if (src.empty()) if (src.empty())
......
...@@ -44,7 +44,7 @@ App::App(int argc, const char* argv[]) ...@@ -44,7 +44,7 @@ App::App(int argc, const char* argv[])
exit(0); exit(0);
} }
String filename = argc == 2 ? argv[1] : "baboon.jpg"; String filename = argc == 2 ? argv[1] : "../data/baboon.jpg";
Mat img = imread(filename); Mat img = imread(filename);
if (img.empty()) if (img.empty())
......
...@@ -281,8 +281,8 @@ TEST(meanShift) ...@@ -281,8 +281,8 @@ TEST(meanShift)
TEST(SURF) TEST(SURF)
{ {
Mat src = imread(abspath("aloeL.jpg"), IMREAD_GRAYSCALE); Mat src = imread(abspath("../data/aloeL.jpg"), IMREAD_GRAYSCALE);
if (src.empty()) throw runtime_error("can't open aloeL.jpg"); if (src.empty()) throw runtime_error("can't open ../data/aloeL.jpg");
xfeatures2d::SURF surf; xfeatures2d::SURF surf;
vector<KeyPoint> keypoints; vector<KeyPoint> keypoints;
...@@ -311,8 +311,8 @@ TEST(SURF) ...@@ -311,8 +311,8 @@ TEST(SURF)
TEST(FAST) TEST(FAST)
{ {
Mat src = imread(abspath("aloeL.jpg"), IMREAD_GRAYSCALE); Mat src = imread(abspath("../data/aloeL.jpg"), IMREAD_GRAYSCALE);
if (src.empty()) throw runtime_error("can't open aloeL.jpg"); if (src.empty()) throw runtime_error("can't open ../data/aloeL.jpg");
vector<KeyPoint> keypoints; vector<KeyPoint> keypoints;
...@@ -336,8 +336,8 @@ TEST(FAST) ...@@ -336,8 +336,8 @@ TEST(FAST)
TEST(ORB) TEST(ORB)
{ {
Mat src = imread(abspath("aloeL.jpg"), IMREAD_GRAYSCALE); Mat src = imread(abspath("../data/aloeL.jpg"), IMREAD_GRAYSCALE);
if (src.empty()) throw runtime_error("can't open aloeL.jpg"); if (src.empty()) throw runtime_error("can't open ../data/aloeL.jpg");
ORB orb(4000); ORB orb(4000);
vector<KeyPoint> keypoints; vector<KeyPoint> keypoints;
...@@ -1065,9 +1065,9 @@ TEST(equalizeHist) ...@@ -1065,9 +1065,9 @@ TEST(equalizeHist)
TEST(Canny) TEST(Canny)
{ {
Mat img = imread(abspath("aloeL.jpg"), IMREAD_GRAYSCALE); Mat img = imread(abspath("../data/aloeL.jpg"), IMREAD_GRAYSCALE);
if (img.empty()) throw runtime_error("can't open aloeL.jpg"); if (img.empty()) throw runtime_error("can't open ../data/aloeL.jpg");
Mat edges(img.size(), CV_8UC1); Mat edges(img.size(), CV_8UC1);
...@@ -1166,8 +1166,8 @@ TEST(gemm) ...@@ -1166,8 +1166,8 @@ TEST(gemm)
TEST(GoodFeaturesToTrack) TEST(GoodFeaturesToTrack)
{ {
Mat src = imread(abspath("aloeL.jpg"), IMREAD_GRAYSCALE); Mat src = imread(abspath("../data/aloeL.jpg"), IMREAD_GRAYSCALE);
if (src.empty()) throw runtime_error("can't open aloeL.jpg"); if (src.empty()) throw runtime_error("can't open ../data/aloeL.jpg");
vector<Point2f> pts; vector<Point2f> pts;
...@@ -1191,11 +1191,11 @@ TEST(GoodFeaturesToTrack) ...@@ -1191,11 +1191,11 @@ TEST(GoodFeaturesToTrack)
TEST(PyrLKOpticalFlow) TEST(PyrLKOpticalFlow)
{ {
Mat frame0 = imread(abspath("rubberwhale1.png")); Mat frame0 = imread(abspath("../data/rubberwhale1.png"));
if (frame0.empty()) throw runtime_error("can't open rubberwhale1.png"); if (frame0.empty()) throw runtime_error("can't open ../data/rubberwhale1.png");
Mat frame1 = imread(abspath("rubberwhale2.png")); Mat frame1 = imread(abspath("../data/rubberwhale2.png"));
if (frame1.empty()) throw runtime_error("can't open rubberwhale2.png"); if (frame1.empty()) throw runtime_error("can't open ../data/rubberwhale2.png");
Mat gray_frame; Mat gray_frame;
cvtColor(frame0, gray_frame, COLOR_BGR2GRAY); cvtColor(frame0, gray_frame, COLOR_BGR2GRAY);
...@@ -1242,7 +1242,7 @@ TEST(PyrLKOpticalFlow) ...@@ -1242,7 +1242,7 @@ TEST(PyrLKOpticalFlow)
TEST(FarnebackOpticalFlow) TEST(FarnebackOpticalFlow)
{ {
const string datasets[] = {"rubberwhale", "basketball"}; const string datasets[] = {"../data/rubberwhale", "../data/basketball"};
for (size_t i = 0; i < sizeof(datasets)/sizeof(*datasets); ++i) { for (size_t i = 0; i < sizeof(datasets)/sizeof(*datasets); ++i) {
for (int fastPyramids = 0; fastPyramids < 2; ++fastPyramids) { for (int fastPyramids = 0; fastPyramids < 2; ++fastPyramids) {
for (int useGaussianBlur = 0; useGaussianBlur < 2; ++useGaussianBlur) { for (int useGaussianBlur = 0; useGaussianBlur < 2; ++useGaussianBlur) {
...@@ -1274,10 +1274,10 @@ TEST(FarnebackOpticalFlow) ...@@ -1274,10 +1274,10 @@ TEST(FarnebackOpticalFlow)
TEST(MOG) TEST(MOG)
{ {
const std::string inputFile = abspath("768x576.avi"); const std::string inputFile = abspath("../data/768x576.avi");
cv::VideoCapture cap(inputFile); cv::VideoCapture cap(inputFile);
if (!cap.isOpened()) throw runtime_error("can't open 768x576.avi"); if (!cap.isOpened()) throw runtime_error("can't open ../data/768x576.avi");
cv::Mat frame; cv::Mat frame;
cap >> frame; cap >> frame;
...@@ -1327,10 +1327,10 @@ TEST(MOG) ...@@ -1327,10 +1327,10 @@ TEST(MOG)
TEST(MOG2) TEST(MOG2)
{ {
const std::string inputFile = abspath("768x576.avi"); const std::string inputFile = abspath("../data/768x576.avi");
cv::VideoCapture cap(inputFile); cv::VideoCapture cap(inputFile);
if (!cap.isOpened()) throw runtime_error("can't open 768x576.avi"); if (!cap.isOpened()) throw runtime_error("can't open ../data/768x576.avi");
cv::Mat frame; cv::Mat frame;
cap >> frame; cap >> frame;
......
...@@ -113,8 +113,8 @@ if __name__ == '__main__': ...@@ -113,8 +113,8 @@ if __name__ == '__main__':
try: try:
fn1, fn2 = args fn1, fn2 = args
except: except:
fn1 = 'data/aero1.jpg' fn1 = '../data/aero1.jpg'
fn2 = 'data/aero3.jpg' fn2 = '../data/aero3.jpg'
img1 = cv2.imread(fn1, 0) img1 = cv2.imread(fn1, 0)
img2 = cv2.imread(fn2, 0) img2 = cv2.imread(fn2, 0)
......
...@@ -43,7 +43,7 @@ if __name__ == '__main__': ...@@ -43,7 +43,7 @@ if __name__ == '__main__':
try: try:
fn = sys.argv[1] fn = sys.argv[1]
except: except:
fn = '../cpp/baboon.jpg' fn = '../data/baboon.jpg'
src = cv2.imread(fn) src = cv2.imread(fn)
......
...@@ -31,7 +31,7 @@ if __name__ == '__main__': ...@@ -31,7 +31,7 @@ if __name__ == '__main__':
fn = sys.argv[1] fn = sys.argv[1]
except: except:
fn = 0 fn = 0
cam = video.create_capture(fn, fallback='synth:bg=../cpp/baboon.jpg:class=chess:noise=0.05') cam = video.create_capture(fn, fallback='synth:bg=../data/baboon.jpg:class=chess:noise=0.05')
while True: while True:
flag, frame = cam.read() flag, frame = cam.read()
......
...@@ -19,11 +19,11 @@ Usage: ...@@ -19,11 +19,11 @@ Usage:
ESC - exit ESC - exit
Examples: Examples:
deconvolution.py --angle 135 --d 22 data/licenseplate_motion.jpg deconvolution.py --angle 135 --d 22 ../data/licenseplate_motion.jpg
(image source: http://www.topazlabs.com/infocus/_images/licenseplate_compare.jpg) (image source: http://www.topazlabs.com/infocus/_images/licenseplate_compare.jpg)
deconvolution.py --angle 86 --d 31 data/text_motion.jpg deconvolution.py --angle 86 --d 31 ../data/text_motion.jpg
deconvolution.py --circle --d 19 data/text_defocus.jpg deconvolution.py --circle --d 19 ../data/text_defocus.jpg
(image source: compact digital photo camera, no artificial distortion) (image source: compact digital photo camera, no artificial distortion)
...@@ -70,7 +70,7 @@ if __name__ == '__main__': ...@@ -70,7 +70,7 @@ if __name__ == '__main__':
try: try:
fn = args[0] fn = args[0]
except: except:
fn = 'data/licenseplate_motion.jpg' fn = '../data/licenseplate_motion.jpg'
win = 'deconvolution' win = 'deconvolution'
......
...@@ -56,7 +56,7 @@ if __name__ == "__main__": ...@@ -56,7 +56,7 @@ if __name__ == "__main__":
if len(sys.argv)>1: if len(sys.argv)>1:
im = cv2.imread(sys.argv[1]) im = cv2.imread(sys.argv[1])
else : else :
im = cv2.imread('../c/baboon.jpg') im = cv2.imread('../data/baboon.jpg')
print "usage : python dft.py <image_file>" print "usage : python dft.py <image_file>"
# convert to grayscale # convert to grayscale
......
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
''' '''
SVM and KNearest digit recognition. SVM and KNearest digit recognition.
Sample loads a dataset of handwritten digits from 'digits.png'. Sample loads a dataset of handwritten digits from '../data/digits.png'.
Then it trains a SVM and KNearest classifiers on it and evaluates Then it trains a SVM and KNearest classifiers on it and evaluates
their accuracy. their accuracy.
...@@ -38,7 +38,7 @@ from common import clock, mosaic ...@@ -38,7 +38,7 @@ from common import clock, mosaic
SZ = 20 # size of each digit is SZ x SZ SZ = 20 # size of each digit is SZ x SZ
CLASS_N = 10 CLASS_N = 10
DIGITS_FN = 'data/digits.png' DIGITS_FN = '../data/digits.png'
def split2d(img, cell_size, flatten=True): def split2d(img, cell_size, flatten=True):
h, w = img.shape[:2] h, w = img.shape[:2]
......
...@@ -22,7 +22,7 @@ if __name__ == '__main__': ...@@ -22,7 +22,7 @@ if __name__ == '__main__':
try: try:
fn = sys.argv[1] fn = sys.argv[1]
except: except:
fn = '../cpp/fruits.jpg' fn = '../data/fruits.jpg'
print __doc__ print __doc__
img = cv2.imread(fn, 0) img = cv2.imread(fn, 0)
......
...@@ -38,7 +38,7 @@ if __name__ == '__main__': ...@@ -38,7 +38,7 @@ if __name__ == '__main__':
cascade = cv2.CascadeClassifier(cascade_fn) cascade = cv2.CascadeClassifier(cascade_fn)
nested = cv2.CascadeClassifier(nested_fn) nested = cv2.CascadeClassifier(nested_fn)
cam = create_capture(video_src, fallback='synth:bg=../cpp/lena.jpg:noise=0.05') cam = create_capture(video_src, fallback='synth:bg=../data/lena.jpg:noise=0.05')
while True: while True:
ret, img = cam.read() ret, img = cam.read()
......
...@@ -139,8 +139,8 @@ if __name__ == '__main__': ...@@ -139,8 +139,8 @@ if __name__ == '__main__':
try: try:
fn1, fn2 = args fn1, fn2 = args
except: except:
fn1 = '../cpp/box.png' fn1 = '../data/box.png'
fn2 = '../cpp/box_in_scene.png' fn2 = '../data/box_in_scene.png'
img1 = cv2.imread(fn1, 0) img1 = cv2.imread(fn1, 0)
img2 = cv2.imread(fn2, 0) img2 = cv2.imread(fn2, 0)
......
...@@ -22,7 +22,7 @@ if __name__ == '__main__': ...@@ -22,7 +22,7 @@ if __name__ == '__main__':
try: try:
fn = sys.argv[1] fn = sys.argv[1]
except: except:
fn = '../cpp/fruits.jpg' fn = '../data/fruits.jpg'
print __doc__ print __doc__
img = cv2.imread(fn, True) img = cv2.imread(fn, True)
......
...@@ -52,7 +52,7 @@ if __name__ == '__main__': ...@@ -52,7 +52,7 @@ if __name__ == '__main__':
try: try:
img_fn = sys.argv[1] img_fn = sys.argv[1]
except: except:
img_fn = '../cpp/baboon.jpg' img_fn = '../data/baboon.jpg'
img = cv2.imread(img_fn) img = cv2.imread(img_fn)
if img is None: if img is None:
......
...@@ -102,9 +102,9 @@ print __doc__ ...@@ -102,9 +102,9 @@ print __doc__
if len(sys.argv) == 2: if len(sys.argv) == 2:
filename = sys.argv[1] # for drawing purposes filename = sys.argv[1] # for drawing purposes
else: else:
print "No input image given, so loading default image, lena.jpg \n" print "No input image given, so loading default image, ../data/lena.jpg \n"
print "Correct Usage: python grabcut.py <filename> \n" print "Correct Usage: python grabcut.py <filename> \n"
filename = '../cpp/lena.jpg' filename = '../data/lena.jpg'
img = cv2.imread(filename) img = cv2.imread(filename)
img2 = img.copy() # a copy of original image img2 = img.copy() # a copy of original image
......
...@@ -57,7 +57,7 @@ if __name__ == '__main__': ...@@ -57,7 +57,7 @@ if __name__ == '__main__':
if len(sys.argv)>1: if len(sys.argv)>1:
fname = sys.argv[1] fname = sys.argv[1]
else : else :
fname = '../cpp/lena.jpg' fname = '../data/lena.jpg'
print "usage : python hist.py <image_file>" print "usage : python hist.py <image_file>"
im = cv2.imread(fname) im = cv2.imread(fname)
......
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
''' '''
This example illustrates how to use cv2.HoughCircles() function. This example illustrates how to use cv2.HoughCircles() function.
Usage: ./houghcircles.py [<image_name>] Usage: ./houghcircles.py [<image_name>]
image argument defaults to ../cpp/board.jpg image argument defaults to ../data/board.jpg
''' '''
import cv2 import cv2
...@@ -15,7 +15,7 @@ print __doc__ ...@@ -15,7 +15,7 @@ print __doc__
try: try:
fn = sys.argv[1] fn = sys.argv[1]
except: except:
fn = "../cpp/board.jpg" fn = "../data/board.jpg"
src = cv2.imread(fn, 1) src = cv2.imread(fn, 1)
img = cv2.cvtColor(src, cv2.COLOR_BGR2GRAY) img = cv2.cvtColor(src, cv2.COLOR_BGR2GRAY)
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
''' '''
This example illustrates how to use Hough Transform to find lines This example illustrates how to use Hough Transform to find lines
Usage: ./houghlines.py [<image_name>] Usage: ./houghlines.py [<image_name>]
image argument defaults to ../cpp/pic1.png image argument defaults to ../data/pic1.png
''' '''
import cv2 import cv2
import numpy as np import numpy as np
...@@ -12,7 +12,7 @@ import math ...@@ -12,7 +12,7 @@ import math
try: try:
fn = sys.argv[1] fn = sys.argv[1]
except: except:
fn = "../cpp/pic1.png" fn = "../data/pic1.png"
print __doc__ print __doc__
src = cv2.imread(fn) src = cv2.imread(fn)
dst = cv2.Canny(src, 50, 200) dst = cv2.Canny(src, 50, 200)
......
...@@ -24,7 +24,7 @@ if __name__ == '__main__': ...@@ -24,7 +24,7 @@ if __name__ == '__main__':
try: try:
fn = sys.argv[1] fn = sys.argv[1]
except: except:
fn = '../cpp/fruits.jpg' fn = '../data/fruits.jpg'
print __doc__ print __doc__
......
...@@ -153,7 +153,7 @@ if __name__ == '__main__': ...@@ -153,7 +153,7 @@ if __name__ == '__main__':
args, dummy = getopt.getopt(sys.argv[1:], '', ['model=', 'data=', 'load=', 'save=']) args, dummy = getopt.getopt(sys.argv[1:], '', ['model=', 'data=', 'load=', 'save='])
args = dict(args) args = dict(args)
args.setdefault('--model', 'rtrees') args.setdefault('--model', 'rtrees')
args.setdefault('--data', '../cpp/letter-recognition.data') args.setdefault('--data', '../data/letter-recognition.data')
print 'loading data %s ...' % args['--data'] print 'loading data %s ...' % args['--data']
samples, responses = load_base(args['--data']) samples, responses = load_base(args['--data'])
......
...@@ -6,7 +6,7 @@ if __name__ == '__main__': ...@@ -6,7 +6,7 @@ if __name__ == '__main__':
try: try:
fn = sys.argv[1] fn = sys.argv[1]
except: except:
fn = '../cpp/fruits.jpg' fn = '../data/fruits.jpg'
img = cv2.imread(fn) img = cv2.imread(fn)
if img is None: if img is None:
......
...@@ -26,7 +26,7 @@ if __name__ == '__main__': ...@@ -26,7 +26,7 @@ if __name__ == '__main__':
try: try:
fn = sys.argv[1] fn = sys.argv[1]
except: except:
fn = '../cpp/baboon.jpg' fn = '../data/baboon.jpg'
img = cv2.imread(fn) img = cv2.imread(fn)
......
...@@ -32,8 +32,8 @@ def write_ply(fn, verts, colors): ...@@ -32,8 +32,8 @@ def write_ply(fn, verts, colors):
if __name__ == '__main__': if __name__ == '__main__':
print 'loading images...' print 'loading images...'
imgL = cv2.pyrDown( cv2.imread('../gpu/aloeL.jpg') ) # downscale images for faster processing imgL = cv2.pyrDown( cv2.imread('../data/aloeL.jpg') ) # downscale images for faster processing
imgR = cv2.pyrDown( cv2.imread('../gpu/aloeR.jpg') ) imgR = cv2.pyrDown( cv2.imread('../data/aloeR.jpg') )
# disparity range is tuned for 'aloe' image pair # disparity range is tuned for 'aloe' image pair
window_size = 3 window_size = 3
......
...@@ -18,7 +18,7 @@ if __name__ == '__main__': ...@@ -18,7 +18,7 @@ if __name__ == '__main__':
try: try:
fn = sys.argv[1] fn = sys.argv[1]
except: except:
fn = 'data/starry_night.jpg' fn = '../data/starry_night.jpg'
img = cv2.imread(fn) img = cv2.imread(fn)
if img is None: if img is None:
......
...@@ -20,8 +20,8 @@ Usage: ...@@ -20,8 +20,8 @@ Usage:
- synth:<params> for procedural video - synth:<params> for procedural video
Synth examples: Synth examples:
synth:bg=../cpp/lena.jpg:noise=0.1 synth:bg=../data/lena.jpg:noise=0.1
synth:class=chess:bg=../cpp/lena.jpg:noise=0.1:size=640x480 synth:class=chess:bg=../data/lena.jpg:noise=0.1:size=640x480
Keys: Keys:
ESC - exit ESC - exit
...@@ -130,8 +130,8 @@ classes = dict(chess=Chess) ...@@ -130,8 +130,8 @@ classes = dict(chess=Chess)
presets = dict( presets = dict(
empty = 'synth:', empty = 'synth:',
lena = 'synth:bg=../cpp/lena.jpg:noise=0.1', lena = 'synth:bg=../data/lena.jpg:noise=0.1',
chess = 'synth:class=chess:bg=../cpp/lena.jpg:noise=0.1:size=640x480' chess = 'synth:class=chess:bg=../data/lena.jpg:noise=0.1:size=640x480'
) )
......
...@@ -79,6 +79,6 @@ if __name__ == '__main__': ...@@ -79,6 +79,6 @@ if __name__ == '__main__':
try: try:
fn = sys.argv[1] fn = sys.argv[1]
except: except:
fn = '../cpp/fruits.jpg' fn = '../data/fruits.jpg'
print __doc__ print __doc__
App(fn).run() App(fn).run()
...@@ -18,7 +18,7 @@ int main(int argc, const char** argv) ...@@ -18,7 +18,7 @@ int main(int argc, const char** argv)
{ {
CommandLineParser cmd(argc, argv, CommandLineParser cmd(argc, argv,
"{ c camera | false | use camera }" "{ c camera | false | use camera }"
"{ f file | 768x576.avi | input video file }" "{ f file | ../data/768x576.avi | input video file }"
"{ t type | mog2 | method's type (knn, mog2) }" "{ t type | mog2 | method's type (knn, mog2) }"
"{ h help | false | print help message }" "{ h help | false | print help message }"
"{ m cpu_mode | false | press 'm' to switch OpenCL<->CPU}"); "{ m cpu_mode | false | press 'm' to switch OpenCL<->CPU}");
......
...@@ -71,7 +71,7 @@ int main(int argc, char** argv) ...@@ -71,7 +71,7 @@ int main(int argc, char** argv)
"{ h help | false | print help message }" "{ h help | false | print help message }"
"{ i input | | specify input image}" "{ i input | | specify input image}"
"{ c camera | -1 | enable camera capturing }" "{ c camera | -1 | enable camera capturing }"
"{ v video | 768x576.avi | use video as input }" "{ v video | ../data/768x576.avi | use video as input }"
"{ g gray | false | convert image to gray one or not}" "{ g gray | false | convert image to gray one or not}"
"{ s scale | 1.0 | resize the image before detect}" "{ s scale | 1.0 | resize the image before detect}"
"{ o output | | specify output path when input is images}"; "{ o output | | specify output path when input is images}";
......
...@@ -141,7 +141,7 @@ static UMat drawSquaresBoth( const UMat& image, ...@@ -141,7 +141,7 @@ static UMat drawSquaresBoth( const UMat& image,
int main(int argc, char** argv) int main(int argc, char** argv)
{ {
const char* keys = const char* keys =
"{ i input | pic1.png | specify input image }" "{ i input | ../data/pic1.png | specify input image }"
"{ o output | squares_output.jpg | specify output save path}" "{ o output | squares_output.jpg | specify output save path}"
"{ h help | false | print help message }" "{ h help | false | print help message }"
"{ m cpu_mode | false | run without OpenCL }"; "{ m cpu_mode | false | run without OpenCL }";
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment