FLANN save/load (Bug #210)
Description
OpenCV enables saving and loading the flann index to/from a file (using SavedIndexParams). However when loading, not only is the index loaded (as it should be), it is also re-built. The result is inefficiency. This can be avoided by a simple check.
Associated revisions
Merge pull request #210 from akarsakov:fix_cvtcolor_luv_rgb
History
Updated by takuya minagawa about 14 years ago
FYI
I encountered the same problem. I could avoid this problem by changing flann.cpp from:
Index::Index(const Matrix<float>& dataset, const [[IndexParams]]& params) { nnIndex = params.createIndex(dataset); nnIndex->buildIndex(); }
to:
Index::Index(const Matrix<float>& dataset, const [[IndexParams]]& params) { nnIndex = params.createIndex(dataset); if(typeid(params)!=typeid(SavedIndexParams)) nnIndex->buildIndex(); }
Updated by Vadim Pisarevsky almost 14 years ago
- Status deleted (
Open)
Updated by Marius Muja over 13 years ago
Index is not rebuilt is the parameters are of type SavedIndexParams. See flann_base.hpp in Index<T>::Index(...) and Index<T>::buildIndex().
- Status set to Done
- (deleted custom field) set to invalid