1
0
mirror of https://github.com/opencv/opencv_contrib.git synced 2025-10-22 07:31:26 +08:00

Fix MS compiler warnings

This commit is contained in:
Vlad Shakhuro
2014-06-27 17:42:23 +04:00
parent 27692f5cd8
commit d8b0e8d53d
5 changed files with 20 additions and 20 deletions

View File

@@ -69,8 +69,8 @@ vector<int> WaldBoost::train(const Mat& data, const Mat& labels)
}
Mat_<float> weights(labels.rows, labels.cols);
float pos_weight = 1. / (2 * pos_count);
float neg_weight = 1. / (2 * neg_count);
float pos_weight = 1.0f / (2 * pos_count);
float neg_weight = 1.0f / (2 * neg_count);
for( int col = 0; col < weights.cols; ++col )
{
if( labels.at<int>(0, col) == +1 )
@@ -101,7 +101,7 @@ vector<int> WaldBoost::train(const Mat& data, const Mat& labels)
}
// Normalize weights
float z = sum(weights)[0];
float z = (float)sum(weights)[0];
for( int col = 0; col < weights.cols; ++col)
{
weights.at<float>(0, col) /= z;