Commit df56f27e authored by Alexander Alekhin's avatar Alexander Alekhin

Merge pull request #483 from cbalint13:slic_lsc

parents e8937cc0 e5612c3c
......@@ -274,10 +274,10 @@ void SuperpixelLSCImpl::getLabelContourMask(OutputArray _mask, bool _thick_line)
if ( !_thick_line ) line_width = 1;
_mask.create( m_height, m_width, CV_8SC1 );
_mask.create( m_height, m_width, CV_8UC1 );
Mat mask = _mask.getMat();
mask.setTo(1);
mask.setTo(0);
const int dx8[8] = { -1, -1, 0, 1, 1, 1, 0, -1 };
const int dy8[8] = { 0, -1, -1, -1, 0, 1, 1, 1 };
......@@ -309,7 +309,7 @@ void SuperpixelLSCImpl::getLabelContourMask(OutputArray _mask, bool _thick_line)
}
if( np > line_width )
{
mask.at<char>(j,k) = -1;
mask.at<char>(j,k) = (uchar)255;
istaken[mainindex] = true;
}
mainindex++;
......
......@@ -1214,7 +1214,7 @@ void SuperpixelSEEDSImpl::getLabelContourMask(OutputArray image, bool thick_line
}
}
if( neighbors > 1 )
*dst.ptr<uchar>(j, k) = (uchar)-1;
*dst.ptr<uchar>(j, k) = (uchar)255;
}
}
}
......
......@@ -258,10 +258,10 @@ void SuperpixelSLICImpl::getLabelContourMask(OutputArray _mask, bool _thick_line
if ( !_thick_line ) line_width = 1;
_mask.create( m_height, m_width, CV_8SC1 );
_mask.create( m_height, m_width, CV_8UC1 );
Mat mask = _mask.getMat();
mask.setTo(1);
mask.setTo(0);
const int dx8[8] = { -1, -1, 0, 1, 1, 1, 0, -1 };
const int dy8[8] = { 0, -1, -1, -1, 0, 1, 1, 1 };
......@@ -293,7 +293,7 @@ void SuperpixelSLICImpl::getLabelContourMask(OutputArray _mask, bool _thick_line
}
if( np > line_width )
{
mask.at<char>(j,k) = -1;
mask.at<char>(j,k) = (uchar)255;
istaken[mainindex] = true;
}
mainindex++;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment