Skip to content

Comments

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

Open
yhabib29 wants to merge 1 commit intodorian3d:masterfrom
yhabib29:opt-opencv4-filenode
Open

Added FileNodeIterator for OpenCV 4.X to optimize vocabulary loading#69
yhabib29 wants to merge 1 commit intodorian3d:masterfrom
yhabib29:opt-opencv4-filenode

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