Example #1
0
 def __init__(self, cameras, baseline_guesses, estimateLandmarks=False, verbose=False, useBlakeZissermanMest=True):
     self.cameras = cameras
     self.useBlakeZissermanMest = useBlakeZissermanMest
     #create the incremental estimator
     self.estimator = ic.IncrementalEstimator(CALIBRATION_GROUP_ID)
     self.linearSolverOptions = self.estimator.getLinearSolverOptions()
     self.optimizerOptions = self.estimator.getOptimizerOptions()
     self.target = CalibrationTarget(cameras[0].ctarget.detector.target(), estimateLandmarks=estimateLandmarks)
     self.initializeBaselineDVs(baseline_guesses)
     #storage for the used views
     self.views = list()
    def recoverCovariance(self):
        #Covariance ordering (=dv ordering)
        #ORDERING:   N=num cams
        #            1. transformation imu-cam0 --> 6
        #            2. camera time2imu --> 1*numCams (only if enabled)

        print "Recovering covariance..."
        estimator = inc.IncrementalEstimator(CALIBRATION_GROUP_ID)
        rval = estimator.addBatch(self.problem, True)
        est_stds = np.sqrt(estimator.getSigma2Theta().diagonal())

        #split and store the variance
        self.std_trafo_ic = np.array(est_stds[0:6])
        self.std_times = np.array(est_stds[6:])