-
-
Notifications
You must be signed in to change notification settings - Fork 828
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
FeatureMatching: Prefix output matches files when using "ranges" to avoid overwrites #628
Conversation
When using range parameters from main_featureMatching, prefix the resulting files with rangeStart/rangeSize (i.e: iteration index when processing all views by chunks). => with matchFilePerImage: avoids overwriting files if a view is present in several iterations => without matchFilePerImage: avoids overwriting the unique resulting file * io: consider all files containing "matches.txt" when loading matches files from a folder
`matchFilePerImage` was activated by default to handle parallel runs of `featureMatching` on different ranges of views of the same scene. This is now handled by the prefix added to output files when using range related parameters.
e761d1a
to
e830096
Compare
* matches are accumulated when successively loading several files using the same PairwiseMatches variable without clearing it * check for duplicates and test deduplication function
Ensure a folder is not considered twice when loading features and matches.
e6eace0
to
8e012c6
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
kudos for adding unit tests! 👍
54e3f76
to
abc661c
Compare
* handle conversions to relative and absolute paths when _absolutePath is defined * update internal relative folder paths when absolutePath is modified * ensure features/matches folders contains no duplicates * [tests] add 'sfmData_test' module + test internal folders management * [software] update global/incrementalSfm
We should update the major version of |
…vention has changed This new version is able to load files with the previous naming convention but not the opposite.
BOOST_CHECK(fs::path(featuresFolders[0]).is_absolute()); | ||
BOOST_CHECK(fs::equivalent(featuresFolders[0], refFolder)); | ||
BOOST_CHECK(fs::path(matchesFolders[0]).is_absolute()); | ||
BOOST_CHECK(fs::equivalent(matchesFolders[0], refFolder)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We could try to add a new folder, like:
sfmData.setAbsolutePath(fs::absolute(filename).string());
sfmData.addFeaturesFolder(fs::absolute(filename) / "uselessFolder/..").string()); // duplicates from non-canonical path
to check the canonical path conversion with duplicates from different input strings.
Description
Introduce an automatic prefix system for matches files when using "range" command-line parameters. The goal of this PR is to ensure a file created for one iteration does not get overwritten in another one.
When generating matches files per image, we rely on minimal viewId of each image pair to create the filename (minViewId.txt). By iterating over sorted viewIds which only match with greater viewIds, this guarantees that files are written only once.
However, the latter condition can be broken in the current pipeline when the file generated by the ImageMatching step declares for one view [B] a match with a view [A] that has an inferior viewId. This occurs when [A] has reached max view matches; the [A,B] view match is moved to [B]. If [A] and [B] are handled in two distinct iterations (1) and (2), "A.txt" will be first written in (1) and overwritten in (2). All matches from (1) are then lost.
By automatically prefixing matches files based on "range" parameters and generating only one matches file per execution by default, this guarantees uniqueness of generated files.
This also changes the loading of matches files, which will now consider all "*matches.txt" files in the given folder. This behavior is retro-compatible with previously generated files.
Features list
Implementation remarks
Prefix is created by dividing rangeStart/rangeSize which reflects the iteration number when working by chunks. This is preferred to random naming for debug purposes.