Skip to content

Commit 5336450

Browse files
authored
Using Scalar::all(0) instead of (uchar)0
1 parent 02acb14 commit 5336450

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

modules/ximgproc/src/globalmatting.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -180,8 +180,8 @@ void GlobalMatting::erodeFB(cv::Mat_<uchar> &trimap, int r)
180180
int w = trimap.cols;
181181
int h = trimap.rows;
182182

183-
cv::Mat_<uchar> foreground(trimap.size(), (uchar)0);
184-
cv::Mat_<uchar> background(trimap.size(), (uchar)0);
183+
cv::Mat_<uchar> foreground(trimap.size(), Scalar::all(0));
184+
cv::Mat_<uchar> background(trimap.size(), Scalar::all(0));
185185

186186
for (int y = 0; y < h; ++y)
187187
for (int x = 0; x < w; ++x)
@@ -402,8 +402,8 @@ void GlobalMatting::erodeFB(cv::Mat &_trimap, int r)
402402
int w = trimap.cols;
403403
int h = trimap.rows;
404404

405-
cv::Mat_<uchar> foreground(trimap.size(), (uchar)0);
406-
cv::Mat_<uchar> background(trimap.size(), (uchar)0);
405+
cv::Mat_<uchar> foreground(trimap.size(), Scalar::all(0));
406+
cv::Mat_<uchar> background(trimap.size(), Scalar::all(0));
407407

408408
for (int y = 0; y < h; ++y)
409409
for (int x = 0; x < w; ++x)

0 commit comments

Comments
 (0)