mirror of
https://github.com/nerfstudio-project/nerfstudio.git
synced 2026-11-11 02:24:38 +08:00
Fix dimension mismatch between downscaled cameras and images in colmap. (#3232)
Co-authored-by: jisung.yoo <jisung.yoo@naverlabs.com>
This commit is contained in:
parent
c8fcf081ec
commit
90cc4f1d1e
@ -478,12 +478,13 @@ class ColmapDataParser(DataParser):
|
||||
with status(msg="[bold yellow]Downscaling images...", spinner="growVertical"):
|
||||
assert downscale_factor > 1
|
||||
assert isinstance(downscale_factor, int)
|
||||
filepath = next(iter(paths))
|
||||
img = Image.open(filepath)
|
||||
w, h = img.size
|
||||
w_scaled, h_scaled = calculate_scaled_size(w, h, downscale_factor, downscale_rounding_mode)
|
||||
# Using %05d ffmpeg commands appears to be unreliable (skips images).
|
||||
for path in paths:
|
||||
# Compute image-wise rescaled width/height.
|
||||
img = Image.open(path)
|
||||
w, h = img.size
|
||||
w_scaled, h_scaled = calculate_scaled_size(w, h, downscale_factor, downscale_rounding_mode)
|
||||
# Downscale images using ffmpeg.
|
||||
nn_flag = "" if not nearest_neighbor else ":flags=neighbor"
|
||||
path_out = get_fname(path)
|
||||
path_out.parent.mkdir(parents=True, exist_ok=True)
|
||||
|
||||
Loading…
Reference in New Issue
Block a user