Commit b5f366fb authored by Vadim Pisarevsky's avatar Vadim Pisarevsky

fixed possible overflow in getThreshVal_Otsu_8u (ticket #602)

parent a2676b27
......@@ -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;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment