8000 Allow png mask without double extension by MotivaCG · Pull Request #3284 · colmap/colmap · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Allow png mask without double extension #3284

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

Merged
merged 21 commits into from
Jun 12, 2025

Conversation

MotivaCG
Copy link
Contributor

By default, COLMAP searches for mask files by appending ".png" to the image filename. However, this can lead to unexpected behavior when the original image already has a ".png" extension. For example, an image named "image0001.png" would require a mask named "image0001.png.png", which is unintuitive and may cause compatibility issues with other tools that rely on masks, potentially requiring duplicate files.

This patch retains the current behavior as the primary lookup method but introduces a fallback: if the image already has a .png extension and the initial mask file is not found, it also checks for a mask with the exact same name. Since COLMAP allows specifying separate directories for images and masks, having identical filenames is not problematic.

Thank you for considering this patch.

@MotivaCG MotivaCG closed this May 20, 2025
@MotivaCG MotivaCG reopened this May 20, 2025
@MotivaCG
Copy link
Contributor Author

Probably I've missed a step, how should I continue running the tests and so?

@ahojnnes ahojnnes enabled auto-merge (squash) May 28, 2025 14:53
Copy link
Contributor
@ahojnnes ahojnnes left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you. LGTM.

@MotivaCG
Copy link
Contributor Author
MotivaCG commented Jun 1, 2025

Updated from master (workflows failed!)

auto-merge was automatically disabled June 2, 2025 08:31

Head branch was pushed to by a user without write access

@MotivaCG
Copy link
Contributor Author
MotivaCG commented Jun 2, 2025

@ahojnnes I've removed const qualifier from mask_path to enable its modification during the fallback check for mask files without a .png extension. That was the reason why the workflows were not compiling.

@ahojnnes ahojnnes enabled auto-merge (squash) June 2, 2025 10:07
@MotivaCG
Copy link
Contributor Author
MotivaCG commented Jun 2, 2025

I'm seeing a code format check failure specifically on the COLMAP (Ubuntu) / ubuntu-22.04 Release (pull_request) CI job, while other checks are passing. I cannot imagine why this specific job is failing on the format check. Any insights?

@ahojnnes
Copy link
Contributor
ahojnnes commented Jun 2, 2025

The code format check is only implemented in this one CI job.

auto-merge was automatically disabled June 2, 2025 14:24

Head branch was pushed to by a user without write access

@ahojnnes ahojnnes enabled auto-merge (squash) June 2, 2025 16:22
auto-merge was automatically disabled June 5, 2025 07:17

Head branch was pushed to by a user without write access

@MotivaCG
Copy link
Contributor Author
MotivaCG commented Jun 6, 2025

That's weird, I've run Clang locally and it triggers no conflicts.

@ahojnnes
Copy link
Contributor
ahojnnes commented Jun 6, 2025

Did you run ./scripts/format/c++.sh? Different versions of clang-format will produce different results. This script ensures you use a consistent command and clang-format version.

@MotivaCG
Copy link
Contributor Author
MotivaCG commented Jun 9, 2025

Done, fingers crossed.

@ahojnnes ahojnnes enabled auto-merge (squash) June 12, 2025 13:47
@ahojnnes ahojnnes merged commit e130660 into colmap:main Jun 12, 2025
14 checks passed
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.

2 participants
0