Suppressed hundreds of useless MSVC warnings (can be reenabled setting cmake variable ENABLE_NOISY_WARNINGS to ON). Fixed some of remaining warnings.

This commit is contained in:
Andrey Kamaev
2012-04-08 21:49:19 +00:00
parent c16a1d86cc
commit 7cc7a3f37d
23 changed files with 200 additions and 181 deletions

View File

@@ -166,7 +166,7 @@ namespace colormap
static Mat linear_colormap(InputArray X,
InputArray r, InputArray g, InputArray b,
float begin, float end, float n) {
return linear_colormap(X,r,g,b,linspace(begin,end,n));
return linear_colormap(X,r,g,b,linspace(begin,end, cvRound(n)));
}
// Interpolates from a base colormap.

View File

@@ -117,7 +117,7 @@ public:
void train(InputArray src, InputArray labels);
// Predicts the label of a query image in src.
int predict(const InputArray src) const;
int predict(InputArray src) const;
// See FaceRecognizer::load.
void load(const FileStorage& fs);
@@ -495,8 +495,8 @@ inline void elbp_(InputArray _src, OutputArray _dst, int radius, int neighbors)
dst.setTo(0);
for(int n=0; n<neighbors; n++) {
// sample points
float x = static_cast<float>(-radius) * sin(2.0*CV_PI*n/static_cast<float>(neighbors));
float y = static_cast<float>(radius) * cos(2.0*CV_PI*n/static_cast<float>(neighbors));
float x = static_cast<float>(-radius * sin(2.0*CV_PI*n/static_cast<float>(neighbors)));
float y = static_cast<float>(radius * cos(2.0*CV_PI*n/static_cast<float>(neighbors)));
// relative indices
int fx = static_cast<int>(floor(x));
int fy = static_cast<int>(floor(y));
@@ -514,7 +514,7 @@ inline void elbp_(InputArray _src, OutputArray _dst, int radius, int neighbors)
for(int i=radius; i < src.rows-radius;i++) {
for(int j=radius;j < src.cols-radius;j++) {
// calculate interpolated value
float t = w1*src.at<_Tp>(i+fy,j+fx) + w2*src.at<_Tp>(i+fy,j+cx) + w3*src.at<_Tp>(i+cy,j+fx) + w4*src.at<_Tp>(i+cy,j+cx);
float t = static_cast<float>(w1*src.at<_Tp>(i+fy,j+fx) + w2*src.at<_Tp>(i+fy,j+cx) + w3*src.at<_Tp>(i+cy,j+fx) + w4*src.at<_Tp>(i+cy,j+cx));
// floating point precision, so check some machine-dependent epsilon
dst.at<int>(i-radius,j-radius) += ((t > src.at<_Tp>(i,j)) || (std::abs(t-src.at<_Tp>(i,j)) < std::numeric_limits<float>::epsilon())) << n;
}
@@ -543,7 +543,7 @@ histc_(const Mat& src, int minVal=0, int maxVal=255, bool normed=false)
// Establish the number of bins.
int histSize = maxVal-minVal+1;
// Set the ranges.
float range[] = { minVal, maxVal } ;
float range[] = { static_cast<float>(minVal), static_cast<float>(maxVal) };
const float* histRange = { range };
// calc histogram
calcHist(&src, 1, 0, Mat(), result, 1, &histSize, &histRange, true, false);

View File

@@ -442,7 +442,7 @@ void cv::Mesh3D::clearOctree(){ octree = Octree(); }
float cv::Mesh3D::estimateResolution(float tryRatio)
{
#if 0
#if 0
const int neighbors = 3;
const int minReasonable = 10;
@@ -476,10 +476,10 @@ float cv::Mesh3D::estimateResolution(float tryRatio)
sort(dist, less<double>());
return resolution = (float)dist[ dist.size() / 2 ];
#else
#else
CV_Error(CV_StsNotImplemented, "");
return 1.f;
#endif
#endif
}
@@ -1182,14 +1182,14 @@ private:
left.erase(pos);
}
else
break;
break;
}
if (group.size() >= 4)
groups.push_back(group);
groups.push_back(group);
}
/* converting the data to final result */
/* converting the data to final result */
for(size_t i = 0; i < groups.size(); ++i)
{
const group_t& group = groups[i];
@@ -1197,7 +1197,7 @@ private:
vector< Vec2i > outgrp;
for(citer pos = group.begin(); pos != group.end(); ++pos)
{
const Match& m = allMatches[*pos];
const Match& m = allMatches[*pos];
outgrp.push_back(Vec2i(subset[m.modelInd], scene.subset[m.sceneInd]));
}
result.push_back(outgrp);