8000 Fix broken loading of image masks on macOS by buesma · Pull Request #1639 · colmap/colmap · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content
Dismiss alert

Fix broken loading of image masks on macOS #1639

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 4 commits into from
Dec 24, 2022
Merged

Fix broken loading of image masks on macOS #1639

merged 4 commits into from
Dec 24, 2022

Conversation

buesma
Copy link
Contributor
@buesma buesma commented Sep 21, 2022

OS: macOS 12.5.1
COLMAP version: 3.8

I experienced the problem that my image masks where not used during feature extraction. Debugging of the mask loading process showed that function GetRelativePath(options_.image_path, image_path) had a faulty behaviour:

  • Inputs (example):
    • options_.image_path: /users/buesma/colmap-ws/images/
    • image_path: /users/buesma/colmap-ws/images/cam1/image0001
  • Retval (expected): cam1/image0001
  • Retval (actual): ../cam1/image0001

This could be related to issues of the BOOST filesystem library with paths with trailing slashs under macOS (probably related boostorg/filesystem#76). The wrong path lead to ExistsFile(mask_path)returning False, and therefore to not loading the image mask.

As options_.image_path is fully contained in image_path, the (for macOS) faulty function for computation of relative paths is not needed at all. In fact, the relative path is already computed with simple string operations for image->Name() (see line 105).

Independent of this problem, mask_path was not processed the same way as image_path, before being assigned to options. This could have led to issues in the future.

buesma and others added 2 commits September 21, 2022 15:24
Remove function for finding the relative path between image root folder and the current image which returns wrong results on macOS.
Instead use of image->Name() which already contains the required relative path.
@buesma
Copy link
Contributor Author
buesma commented Nov 28, 2022

@ahojnnes Is there anything preventing this PR from being merged (other than probably low priority). Please feel free to let me know if something has to be further improved or if my changes need additional justification.

@ahojnnes ahojnnes enabled auto-merge (squash) December 23, 2022 21:49
@ahojnnes
Copy link
Contributor

Thanks for the fix and apologies for the slow feedback.

@ahojnnes ahojnnes merged commit ddd5202 into colmap:dev Dec 24, 2022
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