From: Gary Bradski Date: Wed, 24 Nov 2010 01:44:36 +0000 (+0000) Subject: added and moved docs X-Git-Tag: accepted/tizen/6.0/unified/20201030.111113~8349 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=d0d7ba99855e1dc5854de6bd0d3bf31ab35a78e6;p=platform%2Fupstream%2Fopencv.git added and moved docs --- diff --git a/samples/cpp/calibration.cpp b/samples/cpp/calibration.cpp index 6c8d7fd..cc70734 100644 --- a/samples/cpp/calibration.cpp +++ b/samples/cpp/calibration.cpp @@ -9,30 +9,67 @@ using namespace cv; using namespace std; -/* - example command line for calibration from a live feed. - calibration -w 4 -h 5 -s 0.025 -o camera.yml -op -oe - - example command line for calibration from a list of stored images: - imagelist_creator image_list.xml *.png - calibration -w 4 -h 5 -s 0.025 -o camera.yml -op -oe image_list.xml - where image_list.xml is the standard OpenCV XML/YAML - use imagelist_creator to create the xml or yaml list - file consisting of the list of strings, e.g.: - - - - -"view000.png" -"view001.png" - -"view003.png" -"view010.png" -"one_extra_view.jpg" - - - - */ +const char * usage = +" example command line for calibration from a live feed.\n" +" calibration -w 4 -h 5 -s 0.025 -o camera.yml -op -oe\n" +" \n" +" example command line for calibration from a list of stored images:\n" +" imagelist_creator image_list.xml *.png\n" +" calibration -w 4 -h 5 -s 0.025 -o camera.yml -op -oe image_list.xml\n" +" where image_list.xml is the standard OpenCV XML/YAML\n" +" use imagelist_creator to create the xml or yaml list\n" +" file consisting of the list of strings, e.g.:\n" +" \n" +"\n" +"\n" +"\n" +"view000.png\n" +"view001.png\n" +"\n" +"view003.png\n" +"view010.png\n" +"one_extra_view.jpg\n" +"\n" +"\n"; + + + + +const char* liveCaptureHelp = + "When the live video from camera is used as input, the following hot-keys may be used:\n" + " , 'q' - quit the program\n" + " 'g' - start capturing images\n" + " 'u' - switch undistortion on/off\n"; + +void help() +{ + printf( "This is a camera calibration sample.\n" + "Usage: calibration\n" + " -w # the number of inner corners per one of board dimension\n" + " -h # the number of inner corners per another board dimension\n" + " [-n ] # the number of frames to use for calibration\n" + " # (if not specified, it will be set to the number\n" + " # of board views actually available)\n" + " [-d ] # a minimum delay in ms between subsequent attempts to capture a next view\n" + " # (used only for video capturing)\n" + " [-s ] # square size in some user-defined units (1 by default)\n" + " [-o ] # the output filename for intrinsic [and extrinsic] parameters\n" + " [-op] # write detected feature points\n" + " [-oe] # write extrinsic parameters\n" + " [-zt] # assume zero tangential distortion\n" + " [-a ] # fix aspect ratio (fx/fy)\n" + " [-p] # fix the principal point at the center\n" + " [-v] # flip the captured images around the horizontal axis\n" + " [-su] # show undistorted images after calibration\n" + " [input_data] # input data, one of the following:\n" + " # - text file with a list of the images of the board\n" + " # the text file can be generated with imagelist_creator\n" + " # - name of video file with a video of the board\n" + " # if input_data not specified, a live view from the camera is used\n" + "\n" ); + printf("\n%s",usage); + printf( "\n%s", liveCaptureHelp ); +} enum { DETECTION = 0, CAPTURING = 1, CALIBRATED = 2 }; @@ -247,40 +284,11 @@ int main( int argc, char** argv ) vector > imagePoints; vector imageList; - const char* liveCaptureHelp = - "When the live video from camera is used as input, the following hot-keys may be used:\n" - " , 'q' - quit the program\n" - " 'g' - start capturing images\n" - " 'u' - switch undistortion on/off\n"; if( argc < 2 ) { - printf( "This is a camera calibration sample.\n" - "Usage: calibration\n" - " -w # the number of inner corners per one of board dimension\n" - " -h # the number of inner corners per another board dimension\n" - " [-n ] # the number of frames to use for calibration\n" - " # (if not specified, it will be set to the number\n" - " # of board views actually available)\n" - " [-d ] # a minimum delay in ms between subsequent attempts to capture a next view\n" - " # (used only for video capturing)\n" - " [-s ] # square size in some user-defined units (1 by default)\n" - " [-o ] # the output filename for intrinsic [and extrinsic] parameters\n" - " [-op] # write detected feature points\n" - " [-oe] # write extrinsic parameters\n" - " [-zt] # assume zero tangential distortion\n" - " [-a ] # fix aspect ratio (fx/fy)\n" - " [-p] # fix the principal point at the center\n" - " [-v] # flip the captured images around the horizontal axis\n" - " [-su] # show undistorted images after calibration\n" - " [input_data] # input data, one of the following:\n" - " # - text file with a list of the images of the board\n" - " # the text file can be generated with imagelist_creator\n" - " # - name of video file with a video of the board\n" - " # if input_data not specified, a live view from the camera is used\n" - "\n" ); - printf( "%s", liveCaptureHelp ); - return 0; + help(); + return 0; } for( i = 1; i < argc; i++ )