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

uf_tree indexing fix #1740

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from
Open

uf_tree indexing fix #1740

wants to merge 1 commit into from

Conversation

greenlet
Copy link

No description provided.

@greenlet
Copy link
Author

I measured performance like in the code for the sceaux_global_reconstruction set:

  1. develop baseline gives 3.5 sec
  2. issue-1737-experimental with std::map<indexedFeaturePair, uint32_t> image_feature_index instead of std::set<indexedFeaturePair> allFeatures plus flat_pair_map<indexedFeaturePair, uint32_t> map_node_to_index gives 4.2 sec. So std::map didn't work out
  3. Current issue-1737 with std::unordered_set<indexedFeaturePair, image_feature_hash> allFeatures and flat_pair_map<indexedFeaturePair, uint32_t gives 2.8 sec. Also uf_tree indexing fixed
    https://github.com/openMVG/openMVG/pull/1740/files#diff-cb5e7e1f5559c0a219a2f49376872a98R151
    https://github.com/openMVG/openMVG/pull/1740/files#diff-cb5e7e1f5559c0a219a2f49376872a98R199

@@ -71,7 +78,14 @@ struct TracksBuilder
{
// 1. We need to know how much single set we will have.
// i.e each set is made of a tuple : (imageIndex, featureIndex)
std::set<indexedFeaturePair> allFeatures;
std::unordered_set<indexedFeaturePair, image_feature_hash> allFeatures;
Copy link
Author

Choose a reason for hiding this comment

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

Is it possible to have two similar indexedFeaturePair at all?

Copy link
Member

Choose a reason for hiding this comment

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

We should not since we are using a set

@pmoulon pmoulon added this to the 1.7 milestone May 20, 2020
@pmoulon pmoulon self-assigned this May 20, 2020
@pmoulon
Copy link
Member

pmoulon commented May 20, 2020

I made some benchmark on my machine and I found actually that your version is a bit slower.

Here the results on various datasets.

Dataset Time Old(s) Time New(s) %
chambord 12.3622 15.4362 .8
Dataset_Saint_Lys/Eglise 5.17 5.88403 .87
2017/LaPush/RubyBeach 0.518462 0.658825 .78
2016/Eglise_Cognat 17.0268 20.2247 .85

So on my machine, your code is in average slower (20%)

@greenlet
Copy link
Author

I made some benchmark on my machine and I found actually that your version is a bit slower.

Here the results on various datasets.

Dataset Time Old(s) Time New(s) %
chambord 12.3622 15.4362 .8
Dataset_Saint_Lys/Eglise 5.17 5.88403 .87
2017/LaPush/RubyBeach 0.518462 0.658825 .78
2016/Eglise_Cognat 17.0268 20.2247 .85
So on my machine, your code is in average slower (20%)

What targets your test included? Please note that in current version there is a cycle which should be removed before testing main_exportTracks:
https://github.com/openMVG/openMVG/pull/1740/files#diff-278208fdb61f1a04029842126484e631R129-R137

@pmoulon
Copy link
Member

pmoulon commented May 21, 2020

It could due to the compiler, I will test on another machine to see the impact.
Good point: Memory consumption was identical for both algorithms

@pmoulon pmoulon modified the milestones: 1.7, 2.1 Oct 20, 2021
@pmoulon pmoulon removed this from the 2.1 milestone Dec 28, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants