From 926cab2baaa18295b4a55cd354fe0832b8c0fbae Mon Sep 17 00:00:00 2001 From: Ilya Lavrenov Date: Fri, 6 Dec 2013 13:29:53 +0400 Subject: [PATCH] fixed warnings --- modules/photo/doc/cloning.rst | 4 ++-- modules/photo/doc/npr.rst | 8 ++++---- modules/photo/include/opencv2/photo.hpp | 14 +++++++------- modules/photo/src/contrast_preserve.cpp | 2 +- modules/photo/src/contrast_preserve.hpp | 21 +++++++++++---------- modules/photo/src/npr.cpp | 2 +- modules/photo/test/test_cloning.cpp | 2 +- modules/photo/test/test_npr.cpp | 2 +- samples/cpp/cloning_demo.cpp | 2 +- samples/cpp/npr_demo.cpp | 2 +- 10 files changed, 30 insertions(+), 29 deletions(-) diff --git a/modules/photo/doc/cloning.rst b/modules/photo/doc/cloning.rst index 48c5b24ba1..384c6b676a 100644 --- a/modules/photo/doc/cloning.rst +++ b/modules/photo/doc/cloning.rst @@ -39,7 +39,7 @@ colorChange ----------- Given an original color image, two differently colored versions of this image can be mixed seamlessly. -.. ocv:function:: void colorChange( InputArray src, InputArray mask, OutputArray dst, float red_mul = 1.0, float green_mul = 1.0, float blue_mul = 1.0) +.. ocv:function:: void colorChange( InputArray src, InputArray mask, OutputArray dst, float red_mul = 1.0f, float green_mul = 1.0f, float blue_mul = 1.0f) :param src: Input 8-bit 3-channel image. @@ -61,7 +61,7 @@ illuminationChange Applying an appropriate non-linear transformation to the gradient field inside the selection and then integrating back with a Poisson solver, modifies locally the apparent illumination of an image. -.. ocv:function:: void illuminationChange(InputArray src, InputArray mask, OutputArray dst, float alpha = 0.2, float beta = 0.4) +.. ocv:function:: void illuminationChange(InputArray src, InputArray mask, OutputArray dst, float alpha = 0.2f, float beta = 0.4f) :param src: Input 8-bit 3-channel image. diff --git a/modules/photo/doc/npr.rst b/modules/photo/doc/npr.rst index 48e2db2a7d..123c946c2a 100644 --- a/modules/photo/doc/npr.rst +++ b/modules/photo/doc/npr.rst @@ -8,7 +8,7 @@ edgePreservingFilter Filtering is the fundamental operation in image and video processing. Edge-preserving smoothing filters are used in many different applications. -.. ocv:function:: void edgePreservingFilter(InputArray src, OutputArray dst, int flags = 1, float sigma_s = 60, float sigma_r = 0.4) +.. ocv:function:: void edgePreservingFilter(InputArray src, OutputArray dst, int flags = 1, float sigma_s = 60, float sigma_r = 0.4f) :param src: Input 8-bit 3-channel image. @@ -29,7 +29,7 @@ detailEnhance ------------- This filter enhances the details of a particular image. -.. ocv:function:: void detailEnhance(InputArray src, OutputArray dst, float sigma_s = 10, float sigma_r = 0.15) +.. ocv:function:: void detailEnhance(InputArray src, OutputArray dst, float sigma_s = 10, float sigma_r = 0.15f) :param src: Input 8-bit 3-channel image. @@ -44,7 +44,7 @@ pencilSketch ------------ Pencil-like non-photorealistic line drawing -.. ocv:function:: void pencilSketch(InputArray src, OutputArray dst1, OutputArray dst2, float sigma_s = 60, float sigma_r = 0.07, float shade_factor = 0.02) +.. ocv:function:: void pencilSketch(InputArray src, OutputArray dst1, OutputArray dst2, float sigma_s = 60, float sigma_r = 0.07f, float shade_factor = 0.02f) :param src: Input 8-bit 3-channel image. @@ -63,7 +63,7 @@ stylization ----------- Stylization aims to produce digital imagery with a wide variety of effects not focused on photorealism. Edge-aware filters are ideal for stylization, as they can abstract regions of low contrast while preserving, or enhancing, high-contrast features. -.. ocv:function:: void stylization(InputArray src, OutputArray dst, float sigma_s = 60, float sigma_r = 0.45) +.. ocv:function:: void stylization(InputArray src, OutputArray dst, float sigma_s = 60, float sigma_r = 0.45f) :param src: Input 8-bit 3-channel image. diff --git a/modules/photo/include/opencv2/photo.hpp b/modules/photo/include/opencv2/photo.hpp index 7ca933c3f6..f0e3f8ec8a 100644 --- a/modules/photo/include/opencv2/photo.hpp +++ b/modules/photo/include/opencv2/photo.hpp @@ -306,27 +306,27 @@ CV_EXPORTS_W void decolor( InputArray src, OutputArray grayscale, OutputArray co CV_EXPORTS_W void seamlessClone( InputArray src, InputArray dst, InputArray mask, Point p, OutputArray blend, int flags); -CV_EXPORTS_W void colorChange(InputArray src, InputArray mask, OutputArray dst, float red_mul = 1.0, - float green_mul = 1.0, float blue_mul = 1.0); +CV_EXPORTS_W void colorChange(InputArray src, InputArray mask, OutputArray dst, float red_mul = 1.0f, + float green_mul = 1.0f, float blue_mul = 1.0f); CV_EXPORTS_W void illuminationChange(InputArray src, InputArray mask, OutputArray dst, - float alpha = 0.2, float beta = 0.4); + float alpha = 0.2f, float beta = 0.4f); CV_EXPORTS_W void textureFlattening(InputArray src, InputArray mask, OutputArray dst, double low_threshold = 30, double high_threshold = 45, int kernel_size = 3); CV_EXPORTS_W void edgePreservingFilter(InputArray src, OutputArray dst, int flags = 1, - float sigma_s = 60, float sigma_r = 0.4); + float sigma_s = 60, float sigma_r = 0.4f); CV_EXPORTS_W void detailEnhance(InputArray src, OutputArray dst, float sigma_s = 10, - float sigma_r = 0.15); + float sigma_r = 0.15f); CV_EXPORTS_W void pencilSketch(InputArray src, OutputArray dst1, OutputArray dst2, - float sigma_s = 60, float sigma_r = 0.07, float shade_factor = 0.02); + float sigma_s = 60, float sigma_r = 0.07f, float shade_factor = 0.02f); CV_EXPORTS_W void stylization(InputArray src, OutputArray dst, float sigma_s = 60, - float sigma_r = 0.45); + float sigma_r = 0.45f); } // cv diff --git a/modules/photo/src/contrast_preserve.cpp b/modules/photo/src/contrast_preserve.cpp index 7794b3646d..806afdf312 100644 --- a/modules/photo/src/contrast_preserve.cpp +++ b/modules/photo/src/contrast_preserve.cpp @@ -98,7 +98,7 @@ void cv::decolor(InputArray _src, OutputArray _dst, OutputArray _color_boost) obj.weak_order(img,alf); // Solver - Mat Mt = Mat(polyGrad.size(),polyGrad[0].size(), CV_32FC1); + Mat Mt = Mat((int)polyGrad.size(),(int)polyGrad[0].size(), CV_32FC1); obj.wei_update_matrix(polyGrad,Cg,Mt); vector wei; diff --git a/modules/photo/src/contrast_preserve.hpp b/modules/photo/src/contrast_preserve.hpp index 8a95170e32..f57dc14d32 100644 --- a/modules/photo/src/contrast_preserve.hpp +++ b/modules/photo/src/contrast_preserve.hpp @@ -117,7 +117,7 @@ void Decolor::init() kernely.at(0,0)=1.0; kernely.at(1,0)=-1.0; order = 2; - sigma = .02; + sigma = 0.02f; } vector Decolor::product(vector < vector > &comb, vector &initRGB) @@ -343,18 +343,19 @@ void Decolor::grad_system(Mat img, vector < vector < double > > &polyGrad, void Decolor::wei_update_matrix(vector < vector > &poly, vector &Cg, Mat &X) { - Mat P = Mat(poly.size(),poly[0].size(), CV_32FC1); - Mat A = Mat(poly.size(),poly.size(), CV_32FC1); + int size = static_cast(poly.size()), size0 = static_cast(poly[0].size()); + Mat P = Mat(size, size0, CV_32FC1); + Mat A = Mat(size, size, CV_32FC1); - for(unsigned int i =0;i(i,j) = (float) poly[i][j]; Mat P_trans = P.t(); - Mat B = Mat(poly.size(),poly[0].size(), CV_32FC1); - for(unsigned int i =0;i < poly.size();i++) + Mat B = Mat(size, size0, CV_32FC1); + for(int i =0;i < size;i++) { - for(unsigned int j=0;j(i,j) = (float) (poly[i][j] * Cg[j]); } @@ -414,8 +415,8 @@ void Decolor::grayImContruct(vector &wei, Mat img, Mat &Gray) kk=kk+1; } - float minval = INT_MAX; - float maxval = INT_MIN; + float minval = FLT_MAX; + float maxval = -FLT_MAX; for(int i=0;i