Skip to content
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

Reuse image pair io functionality #1281

Merged
merged 7 commits into from
Nov 10, 2022

Conversation

p12tic
Copy link
Contributor

@p12tic p12tic commented Oct 10, 2022

This PR intends to prevent #1279 from happening again until functional tests for full pipeline are written.

The root cause of #1279 was that operator<< was used in a place where exact file format is expected. It's hard to search for usages of operator<<, so embedding important functionality there is error-prone, as unsuspecting developer may think that the end consumer of the output is human, not other tools. Another cause for the bug was that there were multiple sources of truth on how to output pair list, so there was always likelihood of the accidentally making incompatible changes.

This PR solves the above problems by making image pairs to use a single format defined in imageMatchingComponent.

savePairs has been enhanced to write pairs in the same format as loadPairs accept, namely multiple image pairs per line.

All file IO functionality has been moved to separate functions to aid testing.

Finally, savePairs replaces operator<< for image pairs output.

@p12tic p12tic force-pushed the reuse-image-pair-io branch from 18eadce to ab47199 Compare October 11, 2022 04:54
@fabiencastan fabiencastan added this to the 2.5.0 milestone Oct 11, 2022
@fabiencastan
Copy link
Member

Nice cleanup, just need to include the namespace with the name of the module to keep the rule that we apply everywhere and we can merge it.

@p12tic p12tic force-pushed the reuse-image-pair-io branch from ab47199 to c1293eb Compare October 11, 2022 14:11
@p12tic
Copy link
Contributor Author

p12tic commented Oct 11, 2022

@fabiencastan Addressed your comment.

@p12tic p12tic force-pushed the reuse-image-pair-io branch from c1293eb to 13dd007 Compare October 20, 2022 06:10
@fabiencastan fabiencastan merged commit 02fea92 into alicevision:develop Nov 10, 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