Fix windows build warnings

This commit is contained in:
Andrey Kamaev 2012-09-17 00:42:34 +04:00
parent 089de14ed7
commit e73089bdb5
5 changed files with 10 additions and 10 deletions

View File

@ -774,7 +774,7 @@ bool CV_OperationsTest::TestTemplateMat()
Mat m2 = Mat::zeros(10, 10, CV_8UC3); Mat m2 = Mat::zeros(10, 10, CV_8UC3);
m1.copyTo(m2.row(1)); m1.copyTo(m2.row(1));
} }
catch(const Exception& e) catch(const Exception&)
{ {
badarg_catched = true; badarg_catched = true;
} }

View File

@ -1739,7 +1739,7 @@ PERF_TEST_P(Method_Sz, ImgProc_GeneralizedHough, Combine(
for (int i = 0; i < objCount; ++i) for (int i = 0; i < objCount; ++i)
{ {
double scale = rng.uniform(0.7, 1.3); double scale = rng.uniform(0.7, 1.3);
bool rotate = rng.uniform(0, 2); bool rotate = 1 == rng.uniform(0, 2);
cv::Mat obj; cv::Mat obj;
cv::resize(templ, obj, cv::Size(), scale, scale); cv::resize(templ, obj, cv::Size(), scale, scale);

View File

@ -433,7 +433,7 @@ void CV_Resize_Test::run_reference_func()
double CV_Resize_Test::getWeight(double a, double b, int x) double CV_Resize_Test::getWeight(double a, double b, int x)
{ {
float w = std::min(static_cast<double>(x + 1), b) - std::max(static_cast<double>(x), a); double w = std::min(static_cast<double>(x + 1), b) - std::max(static_cast<double>(x), a);
CV_Assert(w >= 0); CV_Assert(w >= 0);
return w; return w;
} }
@ -514,7 +514,7 @@ void CV_Resize_Test::resize_1d(const Mat& _src, Mat& _dst, int dy, const dim& _d
else if (interpolation == INTER_LINEAR || interpolation == INTER_CUBIC || interpolation == INTER_LANCZOS4) else if (interpolation == INTER_LINEAR || interpolation == INTER_CUBIC || interpolation == INTER_LANCZOS4)
{ {
internal::interpolate_method inter_func = internal::inter_array[interpolation - (interpolation == INTER_LANCZOS4 ? 2 : 1)]; internal::interpolate_method inter_func = internal::inter_array[interpolation - (interpolation == INTER_LANCZOS4 ? 2 : 1)];
int elemsize = _src.elemSize(); size_t elemsize = _src.elemSize();
int ofs = 0, ksize = 2; int ofs = 0, ksize = 2;
if (interpolation == INTER_CUBIC) if (interpolation == INTER_CUBIC)
@ -557,10 +557,10 @@ void CV_Resize_Test::resize_1d(const Mat& _src, Mat& _dst, int dy, const dim& _d
void CV_Resize_Test::generate_buffer(double scale, dim& _dim) void CV_Resize_Test::generate_buffer(double scale, dim& _dim)
{ {
int length = _dim.size(); size_t length = _dim.size();
for (int dx = 0; dx < length; ++dx) for (size_t dx = 0; dx < length; ++dx)
{ {
double fsx = scale * (dx + 0.5f) - 0.5f; double fsx = scale * (dx + 0.5) - 0.5;
int isx = cvFloor(fsx); int isx = cvFloor(fsx);
_dim[dx] = std::make_pair(isx, fsx - isx); _dim[dx] = std::make_pair(isx, fsx - isx);
} }

View File

@ -176,7 +176,7 @@ int main(int argc, char** argv)
// display until user presses q // display until user presses q
imshow(winName, reconstruction); imshow(winName, reconstruction);
char key = 0; int key = 0;
while(key != 'q') while(key != 'q')
key = waitKey(); key = waitKey();

View File

@ -86,7 +86,7 @@ static void run(int argc, char** argv) {
Mat flow; Mat flow;
float start = getTickCount(); float start = (float)getTickCount();
calcOpticalFlowSF(frame1, frame2, calcOpticalFlowSF(frame1, frame2,
flow, flow,
3, 2, 4, 4.1, 25.5, 18, 55.0, 25.5, 0.35, 18, 55.0, 25.5, 10); 3, 2, 4, 4.1, 25.5, 18, 55.0, 25.5, 0.35, 18, 55.0, 25.5, 10);
@ -156,7 +156,7 @@ static float calc_rmse(Mat flow1, Mat flow2) {
} }
} }
} }
return sqrt(sum / (1e-9 + counter)); return (float)sqrt(sum / (1e-9 + counter));
} }
static void eval(int argc, char** argv) { static void eval(int argc, char** argv) {