mirror of
https://github.com/opencv/opencv.git
synced 2025-06-07 17:44:04 +08:00
Merge pull request #5289 from ilya-lavrenov:flann
This commit is contained in:
commit
a98ee0d3b2
@ -318,12 +318,14 @@ buildIndex_(void*& index, const Mat& wholedata, const Mat& data, const IndexPara
|
|||||||
|
|
||||||
::cvflann::Matrix<ElementType> dataset((ElementType*)data.data, data.rows, data.cols);
|
::cvflann::Matrix<ElementType> dataset((ElementType*)data.data, data.rows, data.cols);
|
||||||
|
|
||||||
IndexType* _index = NULL;
|
// currently, additional index support is the lsh algorithm only.
|
||||||
if( !index || getParam<flann_algorithm_t>(params, "algorithm", FLANN_INDEX_LINEAR) != FLANN_INDEX_LSH) // currently, additional index support is the lsh algorithm only.
|
if( !index || getParam<flann_algorithm_t>(params, "algorithm", FLANN_INDEX_LINEAR) != FLANN_INDEX_LSH)
|
||||||
{
|
{
|
||||||
_index = new IndexType(dataset, get_params(params), dist);
|
Ptr<IndexType> _index = makePtr<IndexType>(dataset, get_params(params), dist);
|
||||||
_index->buildIndex();
|
_index->buildIndex();
|
||||||
index = _index;
|
index = _index;
|
||||||
|
// HACK to prevent object destruction
|
||||||
|
_index.obj = NULL;
|
||||||
}
|
}
|
||||||
else // build additional lsh index
|
else // build additional lsh index
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user