Fix: error in the dimension used for computeMinMax

Instead of using the current dimension for which we just got a big span,
we were computing Min and Max for the previous dimension stored in cutfeat
(and using 0 instead of the dimension indice for the very first dimension
with "span > (1-eps)max_span")
pull/17641/head
Pierre-Emmanuel Viel 5 years ago
parent 7fae2e834c
commit 06b4292534
  1. 2
      modules/flann/include/opencv2/flann/kdtree_single_index.h

@ -461,7 +461,7 @@ private:
DistanceType span = bbox[i].high-bbox[i].low;
if (span>(DistanceType)((1-EPS)*max_span)) {
ElementType min_elem, max_elem;
computeMinMax(ind, count, cutfeat, min_elem, max_elem);
computeMinMax(ind, count, (int)i, min_elem, max_elem);
DistanceType spread = (DistanceType)(max_elem-min_elem);
if (spread>max_spread) {
cutfeat = (int)i;

Loading…
Cancel
Save