Rose-Hulman Robotics Team

Changeset 496

Show
Ignore:
Timestamp:
05/20/09 01:10:08 (3 years ago)
Author:
mosttw
Message:

Improvement?

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • trunk/software/scripts/calib/calibrate.c

    r495 r496  
    1111// The number of input images.  Each is named input.%d.jpg, where 
    1212// is in the range [1..NUM_INPUTS] inclusive. 
    13 #define NUM_INPUTS 7 
     13#define NUM_INPUTS 6 
    1414 
    1515// The number of inner corners on the chessboard 
     
    3636  CV_CALIB_CB_FILTER_QUADS, 
    3737  CV_CALIB_CB_ADAPTIVE_THRESH, 
    38   CV_CALIB_CB_ADAPTIVE_THRESH, 
    3938  CV_CALIB_CB_ADAPTIVE_THRESH 
    4039}; 
     
    6059  CvSize pattern_size = cvSize(BOARD_COLS, BOARD_ROWS); 
    6160   
    62   // Find the chessboard corners 
    6361  int success = 1; 
    6462  int total_corners = BOARD_COLS * BOARD_ROWS * NUM_INPUTS; 
     
    8179                                                    &corner_count, 
    8280                                                    CORNER_FLAGS[i]); 
     81    // I'm just guessing with the parameters here. 
     82    //cvFindCornerSubPix(img, my_corners, corner_count, 
     83    //                   cvSize(5, 5), // window to search 
     84    //                   cvSize(-1, -1), // window to ignore (-1 disables) 
     85    //                   cvTermCriteria(CV_TERMCRIT_ITER, 10, 10.0)); 
     86     
    8387    cvDrawChessboardCorners(img, pattern_size, my_corners, corner_count, pattern_was_found); 
    8488    cvSaveImage(out_fn, img); 
     
    135139  // and K_1,3 and K_2,3 contain the camera center, which should be half 
    136140  // the image dimensions. 
    137   float K_data[] = {0.0, 0.0, IMAGE_WIDTH / 2.0, 
    138                     0.0, 0.0, IMAGE_HEIGHT / 2.0, 
     141  float K_data[] = {1.0, 0.0, 0.0, 
     142                    0.0, 1.0, 0.0, 
    139143                    0.0, 0.0, 1.0}; 
    140144  CvMat K = cvMat(3, 3, CV_32FC1, &K_data); 
     
    154158                     NULL, // rotation_vectors 
    155159                     NULL, // translation_vectors 
    156                      0); 
     160                     CV_CALIB_FIX_ASPECT_RATIO); 
    157161   
    158162  printf("\nK:\n"); 
     
    162166 
    163167} 
     168