Skip to content

Commit df56f27

Browse files
committed
Merge pull request #483 from cbalint13:slic_lsc
2 parents e8937cc + e5612c3 commit df56f27

File tree

3 files changed

+7
-7
lines changed

3 files changed

+7
-7
lines changed

modules/ximgproc/src/lsc.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -274,10 +274,10 @@ void SuperpixelLSCImpl::getLabelContourMask(OutputArray _mask, bool _thick_line)
274274

275275
if ( !_thick_line ) line_width = 1;
276276

277-
_mask.create( m_height, m_width, CV_8SC1 );
277+
_mask.create( m_height, m_width, CV_8UC1 );
278278
Mat mask = _mask.getMat();
279279

280-
mask.setTo(1);
280+
mask.setTo(0);
281281

282282
const int dx8[8] = { -1, -1, 0, 1, 1, 1, 0, -1 };
283283
const int dy8[8] = { 0, -1, -1, -1, 0, 1, 1, 1 };
@@ -309,7 +309,7 @@ void SuperpixelLSCImpl::getLabelContourMask(OutputArray _mask, bool _thick_line)
309309
}
310310
if( np > line_width )
311311
{
312-
mask.at<char>(j,k) = -1;
312+
mask.at<char>(j,k) = (uchar)255;
313313
istaken[mainindex] = true;
314314
}
315315
mainindex++;

modules/ximgproc/src/seeds.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1214,7 +1214,7 @@ void SuperpixelSEEDSImpl::getLabelContourMask(OutputArray image, bool thick_line
12141214
}
12151215
}
12161216
if( neighbors > 1 )
1217-
*dst.ptr<uchar>(j, k) = (uchar)-1;
1217+
*dst.ptr<uchar>(j, k) = (uchar)255;
12181218
}
12191219
}
12201220
}

modules/ximgproc/src/slic.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -258,10 +258,10 @@ void SuperpixelSLICImpl::getLabelContourMask(OutputArray _mask, bool _thick_line
258258

259259
if ( !_thick_line ) line_width = 1;
260260

261-
_mask.create( m_height, m_width, CV_8SC1 );
261+
_mask.create( m_height, m_width, CV_8UC1 );
262262
Mat mask = _mask.getMat();
263263

264-
mask.setTo(1);
264+
mask.setTo(0);
265265

266266
const int dx8[8] = { -1, -1, 0, 1, 1, 1, 0, -1 };
267267
const int dy8[8] = { 0, -1, -1, -1, 0, 1, 1, 1 };
@@ -293,7 +293,7 @@ void SuperpixelSLICImpl::getLabelContourMask(OutputArray _mask, bool _thick_line
293293
}
294294
if( np > line_width )
295295
{
296-
mask.at<char>(j,k) = -1;
296+
mask.at<char>(j,k) = (uchar)255;
297297
istaken[mainindex] = true;
298298
}
299299
mainindex++;

0 commit comments

Comments
 (0)