projects
/
platform
/
upstream
/
opencv.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
a2676b2
)
fixed possible overflow in getThreshVal_Otsu_8u (ticket #602)
author
Vadim Pisarevsky
<no@email>
Thu, 4 Nov 2010 12:38:27 +0000
(12:38 +0000)
committer
Vadim Pisarevsky
<no@email>
Thu, 4 Nov 2010 12:38:27 +0000
(12:38 +0000)
modules/imgproc/src/thresh.cpp
patch
|
blob
|
history
diff --git
a/modules/imgproc/src/thresh.cpp
b/modules/imgproc/src/thresh.cpp
index
8eefdf4
..
f041e43
100644
(file)
--- a/
modules/imgproc/src/thresh.cpp
+++ b/
modules/imgproc/src/thresh.cpp
@@
-444,7
+444,7
@@
getThreshVal_Otsu_8u( const Mat& _src )
double mu = 0, scale = 1./(size.width*size.height);
for( i = 0; i < N; i++ )
- mu += i*h[i];
+ mu += i*
(double)
h[i];
mu *= scale;
double mu1 = 0, q1 = 0;