def calib_read(fn, scale): db = AttrDict.load_yaml(fn) P0 = np.float32(db[calib_left].split(' ')) P1 = np.float32(db[calib_right].split(' ')) fx, cx, cy = P0[0], P0[2], P0[6] baseline_px = np.fabs(P1[3]) return StereoCamera.from_calib_params(fx, fx, cx, cy, baseline_px=baseline_px)
def load(cls, filename): db = AttrDict.load_yaml(filename) shape = np.int32([ db.width, db.height ]) if hasattr(db, 'width') and hasattr(db, 'height') else None return cls.from_calib_params(db.fx, db.fy, db.cx, db.cy, k1=db.k1, k2=db.k2, k3=db.k3, p1=db.p1, p2=db.p2, shape=shape)
def load(cls, filename): db = AttrDict.load_yaml(filename) return cls(R=np.float64(db.R), t=np.float64(db.t))