From 3b075a50e937d264b23444f190c1e2491f65f5b1 Mon Sep 17 00:00:00 2001 From: Anatoly Baksheev Date: Fri, 21 Sep 2012 13:41:36 +0400 Subject: [PATCH] fixed warnings under windows --- modules/gpu/src/hough.cpp | 22 +++++++++++----------- modules/imgproc/src/generalized_hough.cpp | 2 +- modules/imgproc/test/test_imgwarp.cpp | 2 +- 3 files changed, 13 insertions(+), 13 deletions(-) diff --git a/modules/gpu/src/hough.cpp b/modules/gpu/src/hough.cpp index 9cfcd92..6d96d38 100644 --- a/modules/gpu/src/hough.cpp +++ b/modules/gpu/src/hough.cpp @@ -730,7 +730,7 @@ namespace GHT_Ballard_Pos_calcHist_gpu(edgePointList.ptr(0), edgePointList.ptr(1), edgePointList.cols, r_table, r_sizes.ptr(), hist, - dp, levels); + (float)dp, levels); } } @@ -742,7 +742,7 @@ namespace ensureSizeIsEnough(2, maxSize, CV_32FC4, outBuf); - posCount = GHT_Ballard_Pos_findPosInHist_gpu(hist, outBuf.ptr(0), outBuf.ptr(1), maxSize, dp, votesThreshold); + posCount = GHT_Ballard_Pos_findPosInHist_gpu(hist, outBuf.ptr(0), outBuf.ptr(1), maxSize, (float)dp, votesThreshold); } ///////////////////////////////////// @@ -813,7 +813,7 @@ namespace GHT_Ballard_PosScale_calcHist_gpu(edgePointList.ptr(0), edgePointList.ptr(1), edgePointList.cols, r_table, r_sizes.ptr(), hist, rows, cols, - minScale, scaleStep, scaleRange, dp, levels); + (float)minScale, (float)scaleStep, scaleRange, (float)dp, levels); } } @@ -830,7 +830,7 @@ namespace ensureSizeIsEnough(2, maxSize, CV_32FC4, outBuf); - posCount = GHT_Ballard_PosScale_findPosInHist_gpu(hist, rows, cols, scaleRange, outBuf.ptr(0), outBuf.ptr(1), maxSize, minScale, scaleStep, dp, votesThreshold); + posCount = GHT_Ballard_PosScale_findPosInHist_gpu(hist, rows, cols, scaleRange, outBuf.ptr(0), outBuf.ptr(1), maxSize, (float)minScale, (float)scaleStep, (float)dp, votesThreshold); } ///////////////////////////////////// @@ -901,7 +901,7 @@ namespace GHT_Ballard_PosRotation_calcHist_gpu(edgePointList.ptr(0), edgePointList.ptr(1), edgePointList.cols, r_table, r_sizes.ptr(), hist, rows, cols, - minAngle, angleStep, angleRange, dp, levels); + (float)minAngle, (float)angleStep, angleRange, (float)dp, levels); } } @@ -918,7 +918,7 @@ namespace ensureSizeIsEnough(2, maxSize, CV_32FC4, outBuf); - posCount = GHT_Ballard_PosRotation_findPosInHist_gpu(hist, rows, cols, angleRange, outBuf.ptr(0), outBuf.ptr(1), maxSize, minAngle, angleStep, dp, votesThreshold); + posCount = GHT_Ballard_PosRotation_findPosInHist_gpu(hist, rows, cols, angleRange, outBuf.ptr(0), outBuf.ptr(1), maxSize, (float)minAngle, (float)angleStep, (float)dp, votesThreshold); } ///////////////////////////////////////// @@ -1205,7 +1205,7 @@ namespace if (edgePointList.cols > 0) { build_func(edgePointList.ptr(0), edgePointList.ptr(1), edgePointList.cols, - features.sizes.ptr(), maxSize, xi, angleEpsilon, levels, make_float2(center.x, center.y), maxDist); + features.sizes.ptr(), maxSize, (float)xi, (float)angleEpsilon, levels, make_float2((float)center.x, (float)center.y), (float)maxDist); } } @@ -1218,7 +1218,7 @@ namespace hist.setTo(Scalar::all(0)); GHT_Guil_Full_calcOHist_gpu(templFeatures.sizes.ptr(), imageFeatures.sizes.ptr(0), - hist.ptr(), minAngle, maxAngle, angleStep, angleRange, levels, templFeatures.maxSize); + hist.ptr(), (float)minAngle, (float)maxAngle, (float)angleStep, angleRange, levels, templFeatures.maxSize); cudaSafeCall( cudaMemcpy(&h_buf[0], hist.data, h_buf.size() * sizeof(int), cudaMemcpyDeviceToHost) ); angles.clear(); @@ -1242,7 +1242,7 @@ namespace hist.setTo(Scalar::all(0)); GHT_Guil_Full_calcSHist_gpu(templFeatures.sizes.ptr(), imageFeatures.sizes.ptr(0), - hist.ptr(), angle, angleEpsilon, minScale, maxScale, iScaleStep, scaleRange, levels, templFeatures.maxSize); + hist.ptr(), (float)angle, (float)angleEpsilon, (float)minScale, (float)maxScale, (float)iScaleStep, scaleRange, levels, templFeatures.maxSize); cudaSafeCall( cudaMemcpy(&h_buf[0], hist.data, h_buf.size() * sizeof(int), cudaMemcpyDeviceToHost) ); scales.clear(); @@ -1263,10 +1263,10 @@ namespace hist.setTo(Scalar::all(0)); GHT_Guil_Full_calcPHist_gpu(templFeatures.sizes.ptr(), imageFeatures.sizes.ptr(0), - hist, angle, angleEpsilon, scale, dp, levels, templFeatures.maxSize); + hist,(float) (float)angle, (float)angleEpsilon, (float)scale, (float)dp, levels, templFeatures.maxSize); posCount = GHT_Guil_Full_findPosInHist_gpu(hist, outBuf.ptr(0), outBuf.ptr(1), - posCount, maxSize, angle, angleVotes, scale, scaleVotes, dp, posThresh); + posCount, maxSize, (float)angle, angleVotes, (float)scale, scaleVotes, (float)dp, posThresh); } } diff --git a/modules/imgproc/src/generalized_hough.cpp b/modules/imgproc/src/generalized_hough.cpp index b8d6800..846a55f 100644 --- a/modules/imgproc/src/generalized_hough.cpp +++ b/modules/imgproc/src/generalized_hough.cpp @@ -972,7 +972,7 @@ namespace f.p1 = p1; f.p2 = p2; - f.alpha12 = clampAngle(fastAtan2(d.y, d.x) - p1.theta); + f.alpha12 = clampAngle(fastAtan2((float)d.y, (float)d.x) - p1.theta); f.d12 = norm(d); if (f.d12 > maxDist) diff --git a/modules/imgproc/test/test_imgwarp.cpp b/modules/imgproc/test/test_imgwarp.cpp index c8786af..abed4ba 100644 --- a/modules/imgproc/test/test_imgwarp.cpp +++ b/modules/imgproc/test/test_imgwarp.cpp @@ -1502,7 +1502,7 @@ TEST(Imgproc_resize_area, regression) absdiff(actual, expected, diff); Mat one_channel_diff = diff.reshape(1); - int elem_diff = 1.0f; + int elem_diff = 1; Size dsize = actual.size(); bool next = true; for (int dy = 0; dy < dsize.height && next; ++dy) -- 2.7.4