Skip to content

Validate stereo fusion output path before running fusion#4530

Open
behnamasadi wants to merge 1 commit into
colmap:mainfrom
behnamasadi:fix/3117-stereo-fusion-validate-output-path
Open

Validate stereo fusion output path before running fusion#4530
behnamasadi wants to merge 1 commit into
colmap:mainfrom
behnamasadi:fix/3117-stereo-fusion-validate-output-path

Conversation

@behnamasadi

Copy link
Copy Markdown
Contributor

RunStereoFuserImpl validated workspace_format, input_type and output_type up front, but never checked output_path until the results were written by WriteBinaryPlyPoints / Reconstruction::Write* after fusion completed. On large datasets fusion can run for hours, so a misspecified output_path (e.g. an existing directory when output_type is PLY, or a non-existent parent directory) aborted the whole run at the very end with a deferred THROW_CHECK_FILE_OPEN, discarding all the fusion work (issue #3117).

Add an early, output-type-aware validation of output_path in RunStereoFuserImpl before constructing the fuser:

  • PLY writes a single file, so reject an existing directory and require the parent directory to exist.
  • BIN/TXT write a directory of files, so require it to already exist (matching the THROW_CHECK_DIR_EXISTS in Reconstruction::Write*).

Also add a ply_test case asserting that WriteTextPlyPoints / WriteBinaryPlyPoints on a directory path fail cleanly, documenting the underlying deferred-failure behavior the early check guards against.

RunStereoFuserImpl validated workspace_format, input_type and output_type
up front, but never checked output_path until the results were written by
WriteBinaryPlyPoints / Reconstruction::Write* after fusion completed. On
large datasets fusion can run for hours, so a misspecified output_path
(e.g. an existing directory when output_type is PLY, or a non-existent
parent directory) aborted the whole run at the very end with a deferred
THROW_CHECK_FILE_OPEN, discarding all the fusion work (issue colmap#3117).

Add an early, output-type-aware validation of output_path in
RunStereoFuserImpl before constructing the fuser:
  - PLY writes a single file, so reject an existing directory and require
    the parent directory to exist.
  - BIN/TXT write a directory of files, so require it to already exist
    (matching the THROW_CHECK_DIR_EXISTS in Reconstruction::Write*).

Also add a ply_test case asserting that WriteTextPlyPoints /
WriteBinaryPlyPoints on a directory path fail cleanly, documenting the
underlying deferred-failure behavior the early check guards against.
@behnamasadi behnamasadi force-pushed the fix/3117-stereo-fusion-validate-output-path branch from 41e0f03 to 7b80bcc Compare July 14, 2026 07:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant