diff --git a/modules/photo/src/contrast_preserve.hpp b/modules/photo/src/contrast_preserve.hpp index 65ca9c1d3c..1afd4bc3e3 100644 --- a/modules/photo/src/contrast_preserve.hpp +++ b/modules/photo/src/contrast_preserve.hpp @@ -159,12 +159,12 @@ void Decolor::gradvector(const Mat &img, vector &grad) const for(int i=0;i(i, j); + grad[i*width + j] = d_trans.at(i, j); const int offset = width * height; for(int i=0;i(i, j); + grad[offset + i * width + j] = d1_trans.at(i, j); } void Decolor::colorGrad(const Mat &img, vector &Cg) const @@ -212,7 +212,7 @@ void Decolor::weak_order(const Mat &im, vector &alf) const if((h + w) > 800) { const double sizefactor = double(800)/(h+w); - resize(im, img, Size(cvRound(h*sizefactor), cvRound(w*sizefactor))); + resize(im, img, Size(cvRound(w*sizefactor), cvRound(h*sizefactor))); } else { @@ -260,7 +260,7 @@ void Decolor::grad_system(const Mat &im, vector < vector < double > > &polyGrad, if((h + w) > 800) { const double sizefactor = double(800)/(h+w); - resize(im, img, Size(cvRound(h*sizefactor), cvRound(w*sizefactor))); + resize(im, img, Size(cvRound(w*sizefactor), cvRound(h*sizefactor))); } else {