def main():
    np.set_printoptions(suppress=True, precision=8, linewidth=100000000.0)
    camera_parameters = CameraParameters(focal_length=[525.0, 525.0], offset=[319.5, 239.5])
    dataset = TUMDataset(dataset_root)
    G = np.eye(4)
    frame0 = dataset.load_color(0)
    sequence_pred = PoseSequence()
    sequence_pred.add(frame0.timestamp_depth, G)
    for i in tqdm(range(1, dataset.size)):
        frame1 = dataset.load_color(i)
        vo = VisualOdometry(camera_parameters, rgb2gray(frame0.image), frame0.depth_map, rgb2gray(frame1.image))
        DG = vo.estimate_motion(n_coarse_to_fine=6)
        G = np.dot(G, np.linalg.inv(DG))
        sequence_pred.add(frame1.timestamp_depth, G)
        frame0 = frame1
    sequence_pred.save('poses.txt')
def main():
    np.set_printoptions(suppress=True, precision=8, linewidth=100000000.0)
    camera_parameters = CameraParameters(focal_length=[525.0, 525.0], offset=[319.5, 239.5])
    dataset = TUMDataset(dataset_root)
    G = np.eye(4)
    frame0 = dataset.load_color(0)
    sequence_pred = PoseSequence()
    sequence_pred.add(frame0.timestamp_depth, G)
    for i in tqdm(range(1, dataset.size)):
        frame1 = dataset.load_color(i)
        vo = VisualOdometry(camera_parameters, rgb2gray(frame0.image), frame0.depth_map, rgb2gray(frame1.image))
        DG = vo.estimate_motion(n_coarse_to_fine=6)
        G = np.dot(G, np.linalg.inv(DG))
        sequence_pred.add(frame1.timestamp_depth, G)
        frame0 = frame1
    sequence_pred.save('poses.txt')