diff --git a/modules/bgsegm/src/synthetic_seq.cpp b/modules/bgsegm/src/synthetic_seq.cpp index 2dd103311c8..f5e2a388cea 100644 --- a/modules/bgsegm/src/synthetic_seq.cpp +++ b/modules/bgsegm/src/synthetic_seq.cpp @@ -206,7 +206,7 @@ void SyntheticSequenceGenerator::getNextFrame(OutputArray _frame, OutputArray _g _gtMask.create(sz, CV_8U); Mat gtMask = _gtMask.getMat(); - gtMask = 0; + gtMask.setTo(cv::Scalar::all(0)); gtMask(Rect(Point2i(pos), objSz)) = 255; pos += dir * objspeed; diff --git a/modules/img_hash/src/radial_variance_hash.cpp b/modules/img_hash/src/radial_variance_hash.cpp index d442595cc71..375cb57a1a9 100644 --- a/modules/img_hash/src/radial_variance_hash.cpp +++ b/modules/img_hash/src/radial_variance_hash.cpp @@ -276,9 +276,9 @@ class RadialVarianceHashImpl CV_FINAL : public ImgHashBase::ImgHashImpl //Different with PHash, this part reverse the row size and col size, //because cv::Mat is row major but not column major projections_.create(numOfAngelLine_, D, CV_8U); - projections_ = 0; + projections_.setTo(cv::Scalar::all(0)); pixPerLine_.create(1, numOfAngelLine_, CV_32S); - pixPerLine_ = 0; + pixPerLine_.setTo(cv::Scalar::all(0)); int const xOff = createOffSet(input.cols); int const yOff = createOffSet(input.rows); diff --git a/modules/text/src/erfilter.cpp b/modules/text/src/erfilter.cpp index 8e8afbe5472..8af72b43cf5 100644 --- a/modules/text/src/erfilter.cpp +++ b/modules/text/src/erfilter.cpp @@ -4030,8 +4030,8 @@ void MSERsToERStats(InputArray image, vector > &contours, vector& s { Canny(src, canny, canny_th1, canny_th2, canny_aperture_size); } - canny.colRange(0,6).rowRange(0,6) = 0; - canny.colRange(src.cols-5,src.cols).rowRange(src.rows-5,src.rows) = 0; + canny.colRange(0,6).rowRange(0,6).setTo(cv::Scalar::all(0)); + canny.colRange(src.cols-5,src.cols).rowRange(src.rows-5,src.rows).setTo(cv::Scalar::all(0)); SEGMENT seg, seg1, seg2; diff --git a/modules/ximgproc/src/seeds.cpp b/modules/ximgproc/src/seeds.cpp index 268564b3f97..54fac992d25 100644 --- a/modules/ximgproc/src/seeds.cpp +++ b/modules/ximgproc/src/seeds.cpp @@ -136,8 +136,8 @@ class SuperpixelSEEDSImpl : public SuperpixelSEEDS //compute initial label for sublevels: level <= seeds_top_level //this is an equally sized grid with size nr_h[level]*nr_w[level] int computeLabel(int level, int x, int y) { - return std::min(y / (height / nr_wh[2 * level + 1]), nr_wh[2 * level + 1] - 1) * nr_wh[2 * level] - + std::min((x / (width / nr_wh[2 * level])), nr_wh[2 * level] - 1); + return std::min(y * nr_wh[2 * level + 1] / height, nr_wh[2 * level + 1] - 1) * nr_wh[2 * level] + + std::min(x * nr_wh[2 * level] / width, nr_wh[2 * level] - 1); } inline int nrLabels(int level) const { return nr_wh[2 * level + 1] * nr_wh[2 * level];