src/CWhycon.cpp
/*manual calibration can be initiated by pressing 'r' and then clicking circles at four positions (0,0)(fieldLength,0)...*/
manual calibration can be initiated by pressing 'r' and then clicking circles at four positions (0,0)(fieldLength,0)
manual calibration can be initiated by pressing ' r ' and then clicking circles at four positions ( 0 0 ) ( fieldLength 0 )
void CWhycon::manualcalibration(){
    if (currentSegmentArray[0].valid){
        STrackedObject o = objectArray[0];
        moveOne = moveVal;
        if (calibStep < calibrationSteps) calibTmp[calibStep++] = o;
        if (calibStep == calibrationSteps){
            o.x = o.y = o.z = 0;
            for (int k = 0;k<calibrationSteps;k++){
                o.x += calibTmp[k].x;
                o.y += calibTmp[k].y;
                o.z += calibTmp[k].z;
            }
            o.x = o.x/calibrationSteps;	
            o.y = o.y/calibrationSteps;	
            o.z = o.z/calibrationSteps;
            if (calibNum < 4){
                calib[calibNum++] = o;
            }
            if (calibNum == 4){
                trans->calibrate2D(calib,fieldLength,fieldWidth);
                trans->calibrate3D(calib,fieldLength,fieldWidth);
                calibNum++;
                numMarkers = wasMarkers;
                trans->saveCalibration(calibDefPath.c_str());
                trans->transformType = lastTransformType;
                detectorArray[0]->localSearch = false;
            }
            calibStep++;
        }
    }
}
void CWhycon :: manualcalibration ( ) { if ( currentSegmentArray [ 0 ] . valid ) { STrackedObject o = objectArray [ 0 ] ; moveOne = moveVal ; if ( calibStep < calibrationSteps ) calibTmp [ calibStep ++ ] = o ; if ( calibStep == calibrationSteps ) { o . x = o . y = o . z = 0 ; for ( int k = 0 ; k < calibrationSteps ; k ++ ) { o . x += calibTmp [ k ] . x ; o . y += calibTmp [ k ] . y ; o . z += calibTmp [ k ] . z ; } o . x = o . x / calibrationSteps ; o . y = o . y / calibrationSteps ; o . z = o . z / calibrationSteps ; if ( calibNum < 4 ) { calib [ calibNum ++ ] = o ; } if ( calibNum == 4 ) { trans -> calibrate2D ( calib , fieldLength , fieldWidth ) ; trans -> calibrate3D ( calib , fieldLength , fieldWidth ) ; calibNum ++ ; numMarkers = wasMarkers ; trans -> saveCalibration ( calibDefPath . c_str ( ) ) ; trans -> transformType = lastTransformType ; detectorArray [ 0 ] -> localSearch = false ; } calibStep ++ ; } } }
manual calibration can be initiated by pressing 'r' and then clicking circles at four positions (0,0)(fieldLength,0)...
manual calibration can be initiated by pressing ' r ' and then clicking circles at four positions ( 0 0 ) ( fieldLength 0 ) ...
//object found - add to a buffer //does the buffer contain enough data to calculate the object position //was it the last object needed to establish the transform ? //calculate and save transforms