Skip to content

Commit 93f54a5

Browse files
authored
Bringing y to outer loop and x in inner loop
1 parent 48abe60 commit 93f54a5

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
@@ -351,8 +351,8 @@ void GlobalMatting::expansionOfKnownRegionsHelper(const cv::Mat &_image,
351351
int w = image.cols;
352352
int h = image.rows;
353353

354-
for (int x = 0; x < w; ++x)
355-
for (int y = 0; y < h; ++y)
354+
for (int y = 0; y < h; ++y)
355+
for (int x = 0; x < w; ++x)
356356
{
357357
if (trimap(y, x) != 128)
358358
continue;
@@ -383,8 +383,8 @@ void GlobalMatting::expansionOfKnownRegionsHelper(const cv::Mat &_image,
383383
}
384384
}
385385

386-
for (int x = 0; x < trimap.cols; ++x)
387-
for (int y = 0; y < trimap.rows; ++y)
386+
for (int y = 0; y < trimap.rows; ++y)
387+
for (int x = 0; x < trimap.cols; ++x)
388388
{
389389
if (trimap(y, x) == 1)
390390
trimap(y, x) = 0;

0 commit comments

Comments
 (0)