Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

data parser for t&t dataset #347

Merged
merged 1 commit into from
Aug 21, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions examples/datasets/colmap.py
Original file line number Diff line number Diff line change
Expand Up @@ -192,6 +192,19 @@ def __init__(
self.point_indices = point_indices # Dict[str, np.ndarray], image_name -> [M,]
self.transform = transform # np.ndarray, (4, 4)

# load one image to check the size. In the case of tanksandtemples dataset, the
# intrinsics stored in COLMAP corresponds to 2x upsampled images.
actual_image = imageio.imread(self.image_paths[0])[..., :3]
actual_height, actual_width = actual_image.shape[:2]
colmap_width, colmap_height = self.imsize_dict[self.camera_ids[0]]
s_height, s_width = actual_height / colmap_height, actual_width / colmap_width
for camera_id, K in self.Ks_dict.items():
K[0, :] *= s_width
K[1, :] *= s_height
self.Ks_dict[camera_id] = K
width, height = self.imsize_dict[camera_id]
self.imsize_dict[camera_id] = (int(width * s_width), int(height * s_height))

# undistortion
self.mapx_dict = dict()
self.mapy_dict = dict()
Expand Down
Loading