Subversion Repositories seema-scanner

Rev

Rev 48 | Rev 79 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 48 Rev 50
Line 28... Line 28...
28
            continue;
28
            continue;
29
 
29
 
30
        // Camera 0
30
        // Camera 0
31
        std::vector<cv::Point2f> qci0;
31
        std::vector<cv::Point2f> qci0;
32
        // Extract checker corners
32
        // Extract checker corners
33
        bool success0 = cv::findChessboardCorners(SMCalibrationSetI.frame0, checkerCount, qci0, cv::CALIB_CB_ADAPTIVE_THRESH);
33
        bool success0 = cv::findChessboardCorners(SMCalibrationSetI.frame0, checkerCount, qci0, cv::CALIB_CB_ADAPTIVE_THRESH+cv::CALIB_CB_FAST_CHECK);
34
        if(success0){
34
        if(success0){
35
            cv::Mat gray;
35
            cv::Mat gray;
36
            cv::cvtColor(SMCalibrationSetI.frame0, gray, CV_RGB2GRAY);
36
            cv::cvtColor(SMCalibrationSetI.frame0, gray, CV_RGB2GRAY);
37
            cv::cornerSubPix(gray, qci0, cv::Size(5, 5), cv::Size(-1, -1),cv::TermCriteria(CV_TERMCRIT_EPS + CV_TERMCRIT_ITER, 20, 0.001));
37
            cv::cornerSubPix(gray, qci0, cv::Size(5, 5), cv::Size(-1, -1),cv::TermCriteria(CV_TERMCRIT_EPS + CV_TERMCRIT_ITER, 20, 0.001));
38
            // Draw colored chessboard
38
            // Draw colored chessboard
39
            SMCalibrationSetI.frame0Result = SMCalibrationSetI.frame0.clone();
39
            SMCalibrationSetI.frame0Result = SMCalibrationSetI.frame0.clone();
40
            cvtools::drawChessboardCorners(SMCalibrationSetI.frame0Result, checkerCount, qci0, success0, 3);
40
            cvtools::drawChessboardCorners(SMCalibrationSetI.frame0Result, checkerCount, qci0, success0, 10);
41
        }
41
        }
42
 
42
 
43
        emit newFrameResult(i, 0, success0, SMCalibrationSetI.frame0Result);
43
        emit newFrameResult(i, 0, success0, SMCalibrationSetI.frame0Result);
44
 
44
 
45
        // Camera 1
45
        // Camera 1
Line 50... Line 50...
50
            cv::Mat gray;
50
            cv::Mat gray;
51
            cv::cvtColor(SMCalibrationSetI.frame1, gray, CV_RGB2GRAY);
51
            cv::cvtColor(SMCalibrationSetI.frame1, gray, CV_RGB2GRAY);
52
            cv::cornerSubPix(gray, qci1, cv::Size(5, 5), cv::Size(-1, -1),cv::TermCriteria(CV_TERMCRIT_EPS + CV_TERMCRIT_ITER, 20, 0.001));
52
            cv::cornerSubPix(gray, qci1, cv::Size(5, 5), cv::Size(-1, -1),cv::TermCriteria(CV_TERMCRIT_EPS + CV_TERMCRIT_ITER, 20, 0.001));
53
            // Draw colored chessboard
53
            // Draw colored chessboard
54
            SMCalibrationSetI.frame1Result = SMCalibrationSetI.frame1.clone();
54
            SMCalibrationSetI.frame1Result = SMCalibrationSetI.frame1.clone();
55
            cv::drawChessboardCorners(SMCalibrationSetI.frame1Result, checkerCount, qci1, success1);
55
            cvtools::drawChessboardCorners(SMCalibrationSetI.frame1Result, checkerCount, qci1, success1, 10);
56
        }
56
        }
57
 
57
 
58
        emit newFrameResult(i, 1, success1, SMCalibrationSetI.frame1Result);
58
        emit newFrameResult(i, 1, success1, SMCalibrationSetI.frame1Result);
59
 
59
 
60
        SMCalibrationSetI.success = success0 && success1;
60
        SMCalibrationSetI.success = success0 && success1;