From c1a862f175a22394a261d3578b5c33ca76fc68c5 Mon Sep 17 00:00:00 2001 From: Gary Bradski Date: Tue, 23 Nov 2010 08:09:06 +0000 Subject: [PATCH] minor docs and help code at top --- samples/cpp/3calibration.cpp | 53 +++++++++++++++++++++++++++++++------------- 1 file changed, 38 insertions(+), 15 deletions(-) diff --git a/samples/cpp/3calibration.cpp b/samples/cpp/3calibration.cpp index 63088a4..cc9011c 100644 --- a/samples/cpp/3calibration.cpp +++ b/samples/cpp/3calibration.cpp @@ -1,3 +1,7 @@ +/* + * 3calibration.cpp -- Calibrate 3 cameras in a horizontal line together. + */ + #include "opencv2/opencv.hpp" #include #include @@ -8,6 +12,37 @@ using namespace std; enum { DETECTION = 0, CAPTURING = 1, CALIBRATED = 2 }; +void test() +{ + + printf( "This is a camera calibration sample that calibrates 3 horizontally placed cameras together.\n" + "Usage: 3calibration\n" + " -w # the number of inner corners per one of board dimension\n" + " -h # the number of inner corners per another board dimension\n" + " [-s ] # square size in some user-defined units (1 by default)\n" + " [-o ] # the output filename for intrinsic [and 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" + " [input_data] # input data - text file with a list of the images of the board\n" + "\n" ); + +} + + + + + + + + + + + + + + + static void calcChessboardCorners(Size boardSize, float squareSize, vector& corners) { corners.resize(0); @@ -161,21 +196,9 @@ int main( int argc, char** argv ) vector > imgpt[3]; vector imageList; - 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" - " [-s ] # square size in some user-defined units (1 by default)\n" - " [-o ] # the output filename for intrinsic [and 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" - " [input_data] # input data - text file with a list of the images of the board\n" - "\n" ); - return 0; - } + if(argc < 2) + test(); + for( i = 1; i < argc; i++ ) { -- 2.7.4