From 32da602bf7f78eb363401174db9cc377c98ae6d8 Mon Sep 17 00:00:00 2001 From: Alexander Alekhin Date: Wed, 25 Mar 2015 19:09:53 +0300 Subject: [PATCH] fix build (related to PR #3814) --- .../src/fast_nlmeans_denoising_invoker_commons.hpp | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/modules/photo/src/fast_nlmeans_denoising_invoker_commons.hpp b/modules/photo/src/fast_nlmeans_denoising_invoker_commons.hpp index 8f31e8b022..2322919ef8 100644 --- a/modules/photo/src/fast_nlmeans_denoising_invoker_commons.hpp +++ b/modules/photo/src/fast_nlmeans_denoising_invoker_commons.hpp @@ -44,6 +44,14 @@ 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 +namespace std { +template bool isnan(T value) { return _isnan(value) != 0; } +} +#endif + template struct pixelInfo_ { static const int channels = 1; @@ -130,7 +138,7 @@ class DistAbs if (std::isnan(w)) w = 1.0; // Handle h = 0.0 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; return weight; @@ -252,7 +260,7 @@ class DistSquared if (std::isnan(w)) w = 1.0; // Handle h = 0.0 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; return weight;