fix dev by 0 in KL-Divergence

pull/2354/head
gleb.sternharz 11 years ago
parent 05b9c991dd
commit f85aa929f1
  1. 2
      modules/flann/include/opencv2/flann/dist.h

@ -741,7 +741,7 @@ struct KL_Divergence
Iterator1 last = a + size;
while (a < last) {
if (* a != 0) {
if (* b != 0) {
ResultType ratio = (ResultType)(*a / *b);
if (ratio>0) {
result += *a * log(ratio);

Loading…
Cancel
Save