Subversion Repositories seema-scanner

Rev

Rev 164 | Rev 167 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 164 Rev 166
Line 8... Line 8...
8
void SMCalibrationWorker::performCalibration(std::vector<SMCalibrationSet> calibrationData){
8
void SMCalibrationWorker::performCalibration(std::vector<SMCalibrationSet> calibrationData){
9
 
9
 
10
    QSettings settings;
10
    QSettings settings;
11
 
11
 
12
    // Number of saddle points on calibration pattern
12
    // Number of saddle points on calibration pattern
13
    int checkerCountX = settings.value("calibration/checkerCountX", 12).toInt();
13
    int checkerCountX = settings.value("calibration/patternSizeX", 12).toInt();
14
    int checkerCountY = settings.value("calibration/checkerCountY", 11).toInt();
14
    int checkerCountY = settings.value("calibration/patternSizeY", 11).toInt();
15
    cv::Size checkerCount(checkerCountX, checkerCountY);
15
    cv::Size checkerCount(checkerCountX, checkerCountY);
16
 
16
 
17
    int nSets = calibrationData.size();
17
    int nSets = calibrationData.size();
18
 
18
 
19
    // 2D Points collected for OpenCV's calibration procedures
19
    // 2D Points collected for OpenCV's calibration procedures
Line 107... Line 107...
107
        emit done();
107
        emit done();
108
        return;
108
        return;
109
    }
109
    }
110
 
110
 
111
    // Generate world object coordinates [mm]
111
    // Generate world object coordinates [mm]
112
    float checkerSize = settings.value("calibration/checkerSize", 10.0).toFloat(); // width and height of one field in mm
112
    float checkerSize = settings.value("calibration/squareSize", 10.0).toFloat(); // width and height of one checker square in mm
113
    std::vector<cv::Point3f> Qi;
113
    std::vector<cv::Point3f> Qi;
114
    for (int h=0; h<checkerCount.height; h++)
114
    for (int h=0; h<checkerCount.height; h++)
115
        for (int w=0; w<checkerCount.width; w++)
115
        for (int w=0; w<checkerCount.width; w++)
116
            Qi.push_back(cv::Point3f(checkerSize * w, checkerSize* h, 0.0));
116
            Qi.push_back(cv::Point3f(checkerSize * w, checkerSize* h, 0.0));
117
 
117