mirror of
https://github.com/opencv/opencv.git
synced 2025-06-10 19:24:07 +08:00
fix dev by 0 in KL-Divergence
This commit is contained in:
parent
05b9c991dd
commit
f85aa929f1
@ -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…
Reference in New Issue
Block a user