From 8a33d68eac40487e7857c47aecd85222d642969b Mon Sep 17 00:00:00 2001 From: Vincent Rabaud Date: Tue, 29 Jun 2021 00:20:30 +0200 Subject: [PATCH] Do not use = 0 for a cv::Mat. There are several operator= overloads and some compilers can be confused. --- modules/bgsegm/src/synthetic_seq.cpp | 2 +- modules/img_hash/src/radial_variance_hash.cpp | 4 ++-- modules/text/src/erfilter.cpp | 4 ++-- modules/xfeatures2d/src/pct_signatures/pct_clusterizer.cpp | 4 ++-- modules/ximgproc/src/fast_line_detector.cpp | 4 ++-- 5 files changed, 9 insertions(+), 9 deletions(-) diff --git a/modules/bgsegm/src/synthetic_seq.cpp b/modules/bgsegm/src/synthetic_seq.cpp index 2dd103311..f5e2a388c 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 d442595cc..375cb57a1 100644 --- a/modules/img_hash/src/radial_variance_hash.cpp +++ b/modules/img_hash/src/radial_variance_hash.cpp @@ -276,9 +276,9 @@ public: //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 2560b8b05..f8e220d6d 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;