graphdeco-inria / gaussian-splatting

Original reference implementation of "3D Gaussian Splatting for Real-Time Radiance Field Rendering"
https://repo-sam.inria.fr/fungraph/3d-gaussian-splatting/
Other
14.47k stars 1.89k forks source link

"Same image size" requirement #947

Open bo-rc opened 2 months ago

bo-rc commented 2 months ago

Why this assert is needed?:

def loadCam(args, id, cam_info, decompressed_image=None, return_image=False):
    orig_w, orig_h = cam_info.width, cam_info.height
    assert (
        orig_w == utils.get_img_width() and orig_h == utils.get_img_height()
    ), "All images should have the same size. "

The original GS repo does not have this requirement, (see here) so it supports subfolders of images with different image sizes.

def loadCam(args, id, cam_info, resolution_scale, is_test_dataset):
    image = Image.open(cam_info.image_path)
jaco001 commented 2 months ago

But colmap doing its job only with imag es that have same size and orientation.

bo-rc commented 2 months ago

Not necessarily. Let me elaborate a bit here.

Colmap supports multiple "camera modes". One of them is PER_FOLDER camera mode. When this mode is enabled, COLMAP generates undistorted images, which may be in different sizes, one for each camera, separately in subfolders under the images/ parent folder. In this mode, original images should be organized by subfolders, each subfolder contains images from a same camera. The output from COLMAP processing is the undistorted images/ parent folder which maintains the same subfolder structure.

Both original GS and this repo require images\ or undistorted images as input. The latest code from the original GS supports PER_FOLDER camera mode so image sizes are not required to be the same for different cameras.

It looks to me that this repo diverged from the original GS somehow, so migration is not that easy from original GS to this repo. Any ideas to add this support?