You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
// get sum
for (int y = 0; y < height; y++){
for (int x = 0; x < width; x++){
for (int c = 0; c < 3; c++){
val = (float)img.at<cv::Vec3b>(y, x)[c];
sum += val;
squared_sum += (val * val);
}
}
}
// get standard deviation
m = sum / (height * width * channel);
s = sqrt(squared_sum / (height * width * channel) - m * m);
这一部分的均值计算是没有错的,但是,在计算标准差时,怎么能直接把所有rgb值的平方加起来算均值减去m^2?
https://pdfs.semanticscholar.org/fee0/d0c91442d465f343af18b5fce8aeff594d02.pdf
参考文章中STANDARD DEVIATION计算,应该是先计算出均值之后算每个值平方减去均值的平方再开根号。
The text was updated successfully, but these errors were encountered: