Changeset 501
- Timestamp:
- 05/20/09 23:19:37 (3 years ago)
- Location:
- trunk/software/scripts/calib
- Files:
-
- 1 added
- 1 removed
- 7 modified
-
calibrate.c (modified) (5 diffs)
-
capture.sh (added)
-
input.1.jpg (modified) (previous)
-
input.2.jpg (modified) (previous)
-
input.3.jpg (modified) (previous)
-
input.4.jpg (modified) (previous)
-
input.5.jpg (modified) (previous)
-
input.6.jpg (modified) (previous)
-
input.7.jpg (deleted)
Legend:
- Unmodified
- Added
- Removed
-
trunk/software/scripts/calib/calibrate.c
r499 r501 33 33 // The size of the squares on the chessboard, in whatever units 34 34 // you want the calibration to be related to. 35 #define SQUARE_SIZE 1.035 #define SQUARE_SIZE 2.4765 36 36 37 37 // The size of the images from which you are calibrating. … … 45 45 // length of this array must match NUM_INPUTS. 46 46 int CORNER_FLAGS[NUM_INPUTS] = { 47 CV_CALIB_CB_FILTER_QUADS,48 47 CV_CALIB_CB_ADAPTIVE_THRESH, 49 48 CV_CALIB_CB_ADAPTIVE_THRESH, 50 CV_CALIB_CB_FILTER_QUADS, 49 CV_CALIB_CB_ADAPTIVE_THRESH | CV_CALIB_CB_NORMALIZE_IMAGE, 50 CV_CALIB_CB_ADAPTIVE_THRESH, 51 51 CV_CALIB_CB_ADAPTIVE_THRESH, 52 52 CV_CALIB_CB_ADAPTIVE_THRESH … … 82 82 char *out_fn = calloc(100, 1); 83 83 sprintf(in_fn, "input.%d.jpg", i + 1); 84 sprintf(out_fn, "corners.%d. jpg", i + 1);84 sprintf(out_fn, "corners.%d.png", i + 1); 85 85 IplImage* img = cvLoadImage(in_fn, 1); 86 86 if (!img) { 87 fprintf(stderr, "Couldn't open %s\n", in_fn); 88 exit(1); 89 } 90 87 91 // Attempt to find the chessboard 88 92 int corner_count = 0; … … 96 100 //cvFindCornerSubPix(img, my_corners, corner_count, 97 101 // cvSize(5, 5), // window to search 98 // cvSize( -1, -1), // window to ignore (-1 disables)99 // cvTermCriteria(CV_TERMCRIT_ITER , 10, 10.0));102 // cvSize(1, 1), // window to ignore (-1 disables) 103 // cvTermCriteria(CV_TERMCRIT_ITER | CV_TERMCRIT_EPS, 10, 0.1)); 100 104 101 105 cvDrawChessboardCorners(img, pattern_size, my_corners, corner_count, pattern_was_found); … … 157 161 0.0, 0.0, 1.0}; 158 162 CvMat K = cvMat(3, 3, CV_32FC1, &K_data); 159 printf("original K:\n");160 print_matrix(&K);163 //printf("original K:\n"); 164 //print_matrix(&K); 161 165 162 166 CvMat *distortion_coeffs = cvCreateMat(4, 1, CV_32FC1);

