From: Alexander Alekhin Date: Tue, 17 Sep 2013 22:08:53 +0000 (+0400) Subject: fix for broken debug builds (MSVS2010/2012) X-Git-Tag: accepted/tizen/6.0/unified/20201030.111113~3758^2 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=81ac97c6bdd869b8b56a3fc7a5199698e8de220a;p=platform%2Fupstream%2Fopencv.git fix for broken debug builds (MSVS2010/2012) --- diff --git a/modules/optim/src/denoise_tvl1.cpp b/modules/optim/src/denoise_tvl1.cpp index b11ebc0..a2068ba 100644 --- a/modules/optim/src/denoise_tvl1.cpp +++ b/modules/optim/src/denoise_tvl1.cpp @@ -18,6 +18,21 @@ namespace cv{namespace optim{ double _scale; }; +#ifndef OPENCV_NOSTL + using std::transform; +#else + template + static OutputIterator transform (InputIterator first1, InputIterator last1, InputIterator2 first2, + OutputIterator result, BinaryOperator binary_op) + { + while (first1 != last1) + { + *result = binary_op(*first1, *first2); + ++result; ++first1; ++first2; + } + return result; + } +#endif void denoise_TVL1(const std::vector& observations,Mat& result, double lambda, int niters){ CV_Assert(observations.size()>0 && niters>0 && lambda>0); @@ -68,7 +83,7 @@ namespace cv{namespace optim{ //Rs = clip(Rs + sigma*(X-imgs), -clambda, clambda) for(count=0;count<(int)Rs.size();count++){ - std::transform,MatConstIterator_,MatIterator_,AddFloatToCharScaled>( + transform,MatConstIterator_,MatIterator_,AddFloatToCharScaled>( Rs[count].begin(),Rs[count].end(),observations[count].begin(), Rs[count].begin(),AddFloatToCharScaled(-sigma/255.0)); Rs[count]+=sigma*X;