41 useDistanceL1_(
false),
42 rebalancingFactor_(2.0
f)
118 memoryUsage +=
addedDescriptors_.size() * (
sizeof(
int) +
sizeof(cv::Mat) +
sizeof(std::map<int, cv::Mat>::iterator)) +
sizeof(std::map<int, cv::Mat>);
143 const cv::Mat & features,
145 float rebalancingFactor)
150 UASSERT(features.type() == CV_32FC1 || features.type() == CV_8UC1);
188 for(
int i=0;
i<features.rows; ++
i)
203 const cv::Mat & features,
206 float rebalancingFactor)
211 UASSERT(features.type() == CV_32FC1 || features.type() == CV_8UC1);
249 for(
int i=0;
i<features.rows; ++
i)
264 const cv::Mat & features,
268 float rebalancingFactor)
273 UASSERT(features.type() == CV_32FC1 || features.type() == CV_8UC1);
311 for(
int i=0;
i<features.rows; ++
i)
326 const cv::Mat & features,
327 unsigned int table_number,
328 unsigned int key_size,
329 unsigned int multi_probe_level,
330 float rebalancingFactor)
335 UASSERT(features.type() == CV_8UC1);
349 for(
int i=0;
i<features.rows; ++
i)
372 UERROR(
"Flann index not yet created!");
373 return std::vector<unsigned int>();
377 bool indexRebuilt =
false;
378 size_t removedPts = 0;
392 indexRebuilt = index->
removedCount() == 0 && removedPts>0;
409 indexRebuilt = index->
removedCount() == 0 && removedPts>0;
423 indexRebuilt = index->
removedCount() == 0 && removedPts>0;
437 indexRebuilt = index->
removedCount() == 0 && removedPts>0;
454 std::vector<unsigned int> indexes;
455 for(
int i=0;
i<features.rows; ++
i)
468 UERROR(
"Flann index not yet created!");
498 const cv::Mat & query,
508 UERROR(
"Flann index not yet created!");
511 indices.create(query.rows,
knn,
sizeof(
size_t)==8?CV_64F:CV_32S);
544 const cv::Mat & query,
545 std::vector<std::vector<size_t> > & indices,
546 std::vector<std::vector<float> > & dists,
555 UERROR(
"Flann index not yet created!");
560 params.max_neighbors = maxNeighbors<=0?-1:maxNeighbors;
564 std::vector<std::vector<unsigned int> > distsF;
567 dists.resize(distsF.size());
568 for(
unsigned int i=0;
i<dists.size(); ++
i)
570 dists[
i].resize(distsF[
i].
size());
571 for(
unsigned int j=0;
j<distsF[
i].size(); ++
j)