remove const in seamless_cloding APIs for better semantics

pull/21646/head
Zhuo Zhang 3 years ago
parent 2c83cfc14c
commit f5105bac65
No known key found for this signature in database
GPG Key ID: 961A0300B14A36D
  1. 6
      modules/photo/src/seamless_cloning.hpp
  2. 6
      modules/photo/src/seamless_cloning_impl.cpp

@ -53,7 +53,7 @@ namespace cv
class Cloning class Cloning
{ {
public: public:
void normalClone(const cv::Mat& destination, const cv::Mat &mask, const cv::Mat &wmask, cv::Mat &cloned, int flag); void normalClone(const cv::Mat& destination, const cv::Mat &mask, cv::Mat &wmask, cv::Mat &cloned, int flag);
void illuminationChange(cv::Mat &I, cv::Mat &mask, cv::Mat &wmask, cv::Mat &cloned, float alpha, float beta); void illuminationChange(cv::Mat &I, cv::Mat &mask, cv::Mat &wmask, cv::Mat &cloned, float alpha, float beta);
void localColorChange(cv::Mat &I, cv::Mat &mask, cv::Mat &wmask, cv::Mat &cloned, float red_mul, float green_mul, float blue_mul); void localColorChange(cv::Mat &I, cv::Mat &mask, cv::Mat &wmask, cv::Mat &cloned, float red_mul, float green_mul, float blue_mul);
void textureFlatten(cv::Mat &I, cv::Mat &mask, cv::Mat &wmask, float low_threshold, float high_threhold, int kernel_size, cv::Mat &cloned); void textureFlatten(cv::Mat &I, cv::Mat &mask, cv::Mat &wmask, float low_threshold, float high_threhold, int kernel_size, cv::Mat &cloned);
@ -61,10 +61,10 @@ namespace cv
protected: protected:
void initVariables(const cv::Mat &destination, const cv::Mat &binaryMask); void initVariables(const cv::Mat &destination, const cv::Mat &binaryMask);
void computeDerivatives(const cv::Mat &destination, const cv::Mat &patch, const cv::Mat &binaryMask); void computeDerivatives(const cv::Mat &destination, const cv::Mat &patch, cv::Mat &binaryMask);
void scalarProduct(cv::Mat mat, float r, float g, float b); void scalarProduct(cv::Mat mat, float r, float g, float b);
void poisson(const cv::Mat &destination); void poisson(const cv::Mat &destination);
void evaluate(const cv::Mat &I, const cv::Mat &wmask, const cv::Mat &cloned); void evaluate(const cv::Mat &I, cv::Mat &wmask, const cv::Mat &cloned);
void dst(const Mat& src, Mat& dest, bool invert = false); void dst(const Mat& src, Mat& dest, bool invert = false);
void solve(const Mat &img, Mat& mod_diff, Mat &result); void solve(const Mat &img, Mat& mod_diff, Mat &result);

@ -246,7 +246,7 @@ void Cloning::initVariables(const Mat &destination, const Mat &binaryMask)
filter_Y[j] = 2.0f * (float)std::cos(scale * (j + 1)); filter_Y[j] = 2.0f * (float)std::cos(scale * (j + 1));
} }
void Cloning::computeDerivatives(const Mat& destination, const Mat &patch, const Mat &binaryMask) void Cloning::computeDerivatives(const Mat& destination, const Mat &patch, Mat &binaryMask)
{ {
initVariables(destination, binaryMask); initVariables(destination, binaryMask);
@ -306,7 +306,7 @@ void Cloning::poisson(const Mat &destination)
} }
} }
void Cloning::evaluate(const Mat &I, const Mat &wmask, const Mat &cloned) void Cloning::evaluate(const Mat &I, Mat &wmask, const Mat &cloned)
{ {
bitwise_not(wmask,wmask); bitwise_not(wmask,wmask);
@ -320,7 +320,7 @@ void Cloning::evaluate(const Mat &I, const Mat &wmask, const Mat &cloned)
merge(output,cloned); merge(output,cloned);
} }
void Cloning::normalClone(const Mat &destination, const Mat &patch, const Mat &binaryMask, Mat &cloned, int flag) void Cloning::normalClone(const Mat &destination, const Mat &patch, Mat &binaryMask, Mat &cloned, int flag)
{ {
const int w = destination.cols; const int w = destination.cols;
const int h = destination.rows; const int h = destination.rows;

Loading…
Cancel
Save