Fix warnings from MSVC 9 64-bit

pull/91/head
Andrey Kamaev 12 years ago
parent 0072078857
commit afc79e2a02
  1. 4
      modules/features2d/src/fast.cpp
  2. 12
      modules/imgproc/perf/perf_warp.cpp
  3. 6
      modules/stitching/src/seam_finders.cpp

@ -44,6 +44,10 @@ The references are:
#include "precomp.hpp"
#include "fast_score.hpp"
#if defined _MSC_VER
# pragma warning( disable : 4127)
#endif
namespace cv
{

@ -120,10 +120,14 @@ PERF_TEST_P( TestWarpPerspectiveNear_t, WarpPerspectiveNear,
resize(src, src, size);
int shift = src.cols*0.04;
Mat srcVertices = (Mat_<Vec2f>(1, 4) << Vec2f(0, 0), Vec2f(size.width-1, 0),
Vec2f(size.width-1, size.height-1), Vec2f(0, size.height-1));
Mat dstVertices = (Mat_<Vec2f>(1, 4) << Vec2f(0, shift), Vec2f(size.width-shift/2, 0),
Vec2f(size.width-shift, size.height-shift), Vec2f(shift/2, size.height-1));
Mat srcVertices = (Mat_<Vec2f>(1, 4) << Vec2f(0, 0),
Vec2f(static_cast<float>(size.width-1), 0),
Vec2f(static_cast<float>(size.width-1), static_cast<float>(size.height-1)),
Vec2f(0, static_cast<float>(size.height-1)));
Mat dstVertices = (Mat_<Vec2f>(1, 4) << Vec2f(0, static_cast<float>(shift)),
Vec2f(static_cast<float>(size.width-shift/2), 0),
Vec2f(static_cast<float>(size.width-shift), static_cast<float>(size.height-shift)),
Vec2f(static_cast<float>(shift/2), static_cast<float>(size.height-1)));
Mat warpMat = getPerspectiveTransform(srcVertices, dstVertices);
Mat dst(size, type);

@ -628,7 +628,7 @@ bool DpSeamFinder::getSeamTips(int comp1, int comp2, Point &p1, Point &p2)
{
for (int j = i+1; j < nlabels; ++j)
{
double size1 = points[i].size(), size2 = points[j].size();
double size1 = static_cast<double>(points[i].size()), size2 = static_cast<double>(points[j].size());
double cx1 = cvRound(sum[i].x / size1), cy1 = cvRound(sum[i].y / size1);
double cx2 = cvRound(sum[j].x / size2), cy2 = cvRound(sum[j].y / size1);
@ -648,7 +648,7 @@ bool DpSeamFinder::getSeamTips(int comp1, int comp2, Point &p1, Point &p2)
for (int i = 0; i < 2; ++i)
{
double size = points[idx[i]].size();
double size = static_cast<double>(points[idx[i]].size());
double cx = cvRound(sum[idx[i]].x / size);
double cy = cvRound(sum[idx[i]].y / size);
@ -1036,7 +1036,7 @@ void DpSeamFinder::updateLabelsUsingSeam(
for (map<int, int>::iterator itr = connect2.begin(); itr != connect2.end(); ++itr)
{
double len = contours_[comp1].size();
double len = static_cast<double>(contours_[comp1].size());
isAdjComp[itr->first] = itr->second / len > 0.05 && connectOther.find(itr->first)->second / len < 0.1;
}

Loading…
Cancel
Save