def __init__(self, shape, n=1, fovea_shape=None, fill_method='smudge'): """ Arguments --------- shape - Expected shape of disparity images n - Number of past frames to retain fovea_shape - Shape of foveal region to remember (None=whole image) fill_method - default 'smudge' works fine and is fast, other options are 'none' or 'interp' (which is way too slow) """ self.shape = shape self.fovea_shape = fovea_shape self.n = n calib = Calib() self.disp2imu = calib.get_disp2imu() self.imu2disp = calib.get_imu2disp() self.past_position = [] self.past_disparity = [] self.transforms = [] assert fill_method in ('smudge', 'interp', 'none') self.fill_method = fill_method
print(errors) idx = errors.index(min(errors)) return down_factors[idx], iters[idx], fovea_shapes[idx] def get_coarse_subwindow(): pass def get_seed(): pass if __name__ == '__main__': plt.ion() calib = Calib() disp2imu = calib.get_disp2imu() imu2disp = calib.get_imu2disp() drive = 51 video = load_stereo_video(drive) positions = load_video_odometry(drive) initial = video[0] fig = plt.figure(1) fig.clf() ax_disp = plt.gca() plot_disp = ax_disp.imshow(mean_disparity(drive, n_disp), vmin=0, vmax=n_disp) fovea_ij = 100, 600 time_budget = .2 coarse_time_budget = .9 * time_budget