Merge pull request #3875 from alalek:fix_build

This commit is contained in:
Vadim Pisarevsky 2015-03-26 13:09:01 +00:00
commit eff302a231

View File

@ -44,6 +44,14 @@
using namespace cv; using namespace cv;
// std::isnan is a part of C++11 and it is not supported in MSVS2010/2012
#if defined _MSC_VER && _MSC_VER < 1800 /* MSVC 2013 */
#include <float.h>
namespace std {
template <typename T> bool isnan(T value) { return _isnan(value) != 0; }
}
#endif
template <typename T> struct pixelInfo_ template <typename T> struct pixelInfo_
{ {
static const int channels = 1; static const int channels = 1;
@ -130,7 +138,7 @@ class DistAbs
if (std::isnan(w)) w = 1.0; // Handle h = 0.0 if (std::isnan(w)) w = 1.0; // Handle h = 0.0
static const double WEIGHT_THRESHOLD = 0.001; static const double WEIGHT_THRESHOLD = 0.001;
WT weight = (WT)round(fixed_point_mult * w); WT weight = (WT)cvRound(fixed_point_mult * w);
if (weight < WEIGHT_THRESHOLD * fixed_point_mult) weight = 0; if (weight < WEIGHT_THRESHOLD * fixed_point_mult) weight = 0;
return weight; return weight;
@ -252,7 +260,7 @@ class DistSquared
if (std::isnan(w)) w = 1.0; // Handle h = 0.0 if (std::isnan(w)) w = 1.0; // Handle h = 0.0
static const double WEIGHT_THRESHOLD = 0.001; static const double WEIGHT_THRESHOLD = 0.001;
WT weight = (WT)round(fixed_point_mult * w); WT weight = (WT)cvRound(fixed_point_mult * w);
if (weight < WEIGHT_THRESHOLD * fixed_point_mult) weight = 0; if (weight < WEIGHT_THRESHOLD * fixed_point_mult) weight = 0;
return weight; return weight;