Skip to content

undistort_images ignores --max_image_size for already-undistorted cameras (PINHOLE/SIMPLE_PINHOLE) #4508

Description

@xiemeilong

Describe the bug
When running colmap image_undistorter with --max_image_size on a reconstruction whose cameras are already pinhole models (e.g. PINHOLE or SIMPLE_PINHOLE), the camera resolution stored in the output reconstruction is not rescaled. The images themselves may be resized, but the camera intrinsics in cameras.bin/cameras.txt retain the original resolution.

Root Cause:
In UndistortReconstruction() (src/colmap/image/undistortion.cc), cameras for which IsUndistorted() returns true are skipped entirely

To Reproduce
Have a reconstruction with PINHOLE or SIMPLE_PINHOLE cameras at a high resolution (e.g. 4000×3000).
Run colmap image_undistorter --max_image_size 1000 ....
Inspect the output cameras.bin — the camera width/height are unchanged from the original.

Expected behavior
The camera intrinsics in the output reconstruction should be rescaled to match --max_image_size, consistent with the behavior for distorted cameras.

Environment:

  • OS: Linux
  • COLMAP Version: main

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions