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

Added FileNodeIterator for OpenCV 4.X to optimize vocabulary loading #69

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

Conversation

yhabib29
Copy link

@yhabib29 yhabib29 commented Nov 24, 2021

Since OpenCV 4.0.0, the core module has been completely reimplemented in C++.
see https://github.com/opencv/opencv/wiki/ChangeLog#version400

Iterating throught FileNode without iterator has become much more slower.
To compare, see test_filenode program in branch yhabib29/DBoW2#dbg-opencv4.

Average time for each loop iteration in function load in TemplatedVocabulary.h:1454:

  • Without iterator: 1,618,788 ns.
  • Using iterator: 895 ns.
    Tested on vocabulary ORBvoc.yml (download link) with OpenCV 3.4.2 and 4.3.0 .

@yhabib29
Copy link
Author

Duplicate of #68, sorry I did not see the PR

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.

1 participant