Changed parameter type of fastNlMeansDenoising[Multi][Abs] from std::vector<float...
authorErik Karlsson <erik.r.karlsson@gmail.com>
Mon, 9 Mar 2015 22:47:49 +0000 (23:47 +0100)
committerErik Karlsson <erik.r.karlsson@gmail.com>
Mon, 9 Mar 2015 22:47:49 +0000 (23:47 +0100)
modules/photo/include/opencv2/photo.hpp
modules/photo/src/denoising.cpp
modules/photo/src/fast_nlmeans_denoising_opencl.hpp

index 1867d3e..ff98ba7 100644 (file)
@@ -160,8 +160,9 @@ image in different colorspaces. Such approach is used in fastNlMeansDenoisingCol
 image to CIELAB colorspace and then separately denoise L and AB components with different h
 parameter.
  */
-CV_EXPORTS_W void fastNlMeansDenoising( InputArray src, OutputArray dst, std::vector<float> h,
-        int templateWindowSize = 7, int searchWindowSize = 21);
+    CV_EXPORTS_W void fastNlMeansDenoising( InputArray src, OutputArray dst,
+                                        const std::vector<float>& h,
+                                        int templateWindowSize = 7, int searchWindowSize = 21);
 
 /** @brief Perform image denoising using Non-local Means Denoising
 algorithm <http://www.ipol.im/pub/algo/bcm_non_local_means_denoising/>
@@ -212,8 +213,9 @@ image in different colorspaces. Such approach is used in fastNlMeansDenoisingCol
 image to CIELAB colorspace and then separately denoise L and AB components with different h
 parameter.
  */
-CV_EXPORTS_W void fastNlMeansDenoisingAbs( InputArray src, OutputArray dst, std::vector<float> h,
-        int templateWindowSize = 7, int searchWindowSize = 21);
+CV_EXPORTS_W void fastNlMeansDenoisingAbs( InputArray src, OutputArray dst,
+                                           const std::vector<float>& h,
+                                           int templateWindowSize = 7, int searchWindowSize = 21);
 
 /** @brief Modification of fastNlMeansDenoising function for colored images
 
@@ -290,7 +292,7 @@ value preserves details but also preserves some noise
  */
 CV_EXPORTS_W void fastNlMeansDenoisingMulti( InputArrayOfArrays srcImgs, OutputArray dst,
         int imgToDenoiseIndex, int temporalWindowSize,
-        std::vector<float> h , int templateWindowSize = 7, int searchWindowSize = 21);
+        const std::vector<float>& h , int templateWindowSize = 7, int searchWindowSize = 21);
 
 /** @brief Modification of fastNlMeansDenoising function for images
 sequence where consequtive images have been captured in small period
@@ -353,7 +355,7 @@ value preserves details but also preserves some noise
  */
 CV_EXPORTS_W void fastNlMeansDenoisingMultiAbs( InputArrayOfArrays srcImgs, OutputArray dst,
         int imgToDenoiseIndex, int temporalWindowSize,
-        std::vector<float> h, int templateWindowSize = 7, int searchWindowSize = 21);
+        const std::vector<float>& h, int templateWindowSize = 7, int searchWindowSize = 21);
 
 /** @brief Modification of fastNlMeansDenoisingMulti function for colored images sequences
 
index 7dde960..5243b43 100644 (file)
@@ -52,7 +52,7 @@ void cv::fastNlMeansDenoising( InputArray _src, OutputArray _dst, float h,
                          templateWindowSize, searchWindowSize);
 }
 
-void cv::fastNlMeansDenoising( InputArray _src, OutputArray _dst, std::vector<float> h,
+void cv::fastNlMeansDenoising( InputArray _src, OutputArray _dst, const std::vector<float>& h,
                                int templateWindowSize, int searchWindowSize)
 {
     int hn = h.size();
@@ -123,7 +123,7 @@ void cv::fastNlMeansDenoisingAbs( InputArray _src, OutputArray _dst, float h,
                             templateWindowSize, searchWindowSize);
 }
 
-void cv::fastNlMeansDenoisingAbs( InputArray _src, OutputArray _dst, std::vector<float> h,
+void cv::fastNlMeansDenoisingAbs( InputArray _src, OutputArray _dst, const std::vector<float>& h,
                                   int  templateWindowSize, int searchWindowSize)
 {
     int hn = h.size();
@@ -299,7 +299,7 @@ void cv::fastNlMeansDenoisingMulti( InputArrayOfArrays _srcImgs, OutputArray _ds
 
 void cv::fastNlMeansDenoisingMulti( InputArrayOfArrays _srcImgs, OutputArray _dst,
                                     int imgToDenoiseIndex, int temporalWindowSize,
-                                    std::vector<float> h,
+                                    const std::vector<float>& h,
                                     int templateWindowSize, int searchWindowSize)
 {
     std::vector<Mat> srcImgs;
@@ -375,7 +375,7 @@ void cv::fastNlMeansDenoisingMultiAbs( InputArrayOfArrays _srcImgs, OutputArray
 
 void cv::fastNlMeansDenoisingMultiAbs( InputArrayOfArrays _srcImgs, OutputArray _dst,
                                        int imgToDenoiseIndex, int temporalWindowSize,
-                                       std::vector<float> h,
+                                       const std::vector<float>& h,
                                        int templateWindowSize, int searchWindowSize)
 {
     std::vector<Mat> srcImgs;
index a06dc61..b7fdc7c 100644 (file)
@@ -29,7 +29,7 @@ static int divUp(int a, int b)
 }
 
 template <typename FT, typename ST, typename WT>
-static bool ocl_calcAlmostDist2Weight(UMat & almostDist2Weight, int searchWindowSize, int templateWindowSize, FT *h, int hn, int cn,
+static bool ocl_calcAlmostDist2Weight(UMat & almostDist2Weight, int searchWindowSize, int templateWindowSize, const FT *h, int hn, int cn,
                                       int & almostTemplateWindowSizeSqBinShift, bool abs)
 {
     const WT maxEstimateSumValue = searchWindowSize * searchWindowSize *
@@ -78,7 +78,7 @@ static bool ocl_calcAlmostDist2Weight(UMat & almostDist2Weight, int searchWindow
     return k.run(1, globalsize, NULL, false);
 }
 
-static bool ocl_fastNlMeansDenoising(InputArray _src, OutputArray _dst, float *h, int hn,
+static bool ocl_fastNlMeansDenoising(InputArray _src, OutputArray _dst, const float *h, int hn,
                                      int templateWindowSize, int searchWindowSize, bool abs)
 {
     int type = _src.type(), depth = CV_MAT_DEPTH(type), cn = CV_MAT_CN(type);