Merge pull request #6882 from ilya-lavrenov:flann

This commit is contained in:
Alexander Alekhin 2016-07-12 10:49:17 +00:00
commit 3590c3c48e

View File

@ -318,7 +318,19 @@ buildIndex_(void*& index, const Mat& data, const IndexParams& params, const Dist
::cvflann::Matrix<ElementType> dataset((ElementType*)data.data, data.rows, data.cols);
IndexType* _index = new IndexType(dataset, get_params(params), dist);
try
{
_index->buildIndex();
}
catch (...)
{
delete _index;
_index = NULL;
throw;
}
index = _index;
}