From f85aa929f1b0227c6ed2bc983fee8ebf34f48433 Mon Sep 17 00:00:00 2001 From: "gleb.sternharz" Date: Mon, 17 Feb 2014 04:08:30 +0100 Subject: [PATCH] fix dev by 0 in KL-Divergence --- modules/flann/include/opencv2/flann/dist.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/flann/include/opencv2/flann/dist.h b/modules/flann/include/opencv2/flann/dist.h index 80ae2dc91..d293984d7 100644 --- a/modules/flann/include/opencv2/flann/dist.h +++ b/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);