Commit e5612c3c authored by Balint Cristian's avatar Balint Cristian

BugFix Issue No.481 related to SLIC, LSC contour mask values.

parent e8937cc0
...@@ -274,10 +274,10 @@ void SuperpixelLSCImpl::getLabelContourMask(OutputArray _mask, bool _thick_line) ...@@ -274,10 +274,10 @@ void SuperpixelLSCImpl::getLabelContourMask(OutputArray _mask, bool _thick_line)
if ( !_thick_line ) line_width = 1; 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(); Mat mask = _mask.getMat();
mask.setTo(1); mask.setTo(0);
const int dx8[8] = { -1, -1, 0, 1, 1, 1, 0, -1 }; const int dx8[8] = { -1, -1, 0, 1, 1, 1, 0, -1 };
const int dy8[8] = { 0, -1, -1, -1, 0, 1, 1, 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) ...@@ -309,7 +309,7 @@ void SuperpixelLSCImpl::getLabelContourMask(OutputArray _mask, bool _thick_line)
} }
if( np > line_width ) if( np > line_width )
{ {
mask.at<char>(j,k) = -1; mask.at<char>(j,k) = (uchar)255;
istaken[mainindex] = true; istaken[mainindex] = true;
} }
mainindex++; mainindex++;
......
...@@ -1214,7 +1214,7 @@ void SuperpixelSEEDSImpl::getLabelContourMask(OutputArray image, bool thick_line ...@@ -1214,7 +1214,7 @@ void SuperpixelSEEDSImpl::getLabelContourMask(OutputArray image, bool thick_line
} }
} }
if( neighbors > 1 ) 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 ...@@ -258,10 +258,10 @@ void SuperpixelSLICImpl::getLabelContourMask(OutputArray _mask, bool _thick_line
if ( !_thick_line ) line_width = 1; 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(); Mat mask = _mask.getMat();
mask.setTo(1); mask.setTo(0);
const int dx8[8] = { -1, -1, 0, 1, 1, 1, 0, -1 }; const int dx8[8] = { -1, -1, 0, 1, 1, 1, 0, -1 };
const int dy8[8] = { 0, -1, -1, -1, 0, 1, 1, 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 ...@@ -293,7 +293,7 @@ void SuperpixelSLICImpl::getLabelContourMask(OutputArray _mask, bool _thick_line
} }
if( np > line_width ) if( np > line_width )
{ {
mask.at<char>(j,k) = -1; mask.at<char>(j,k) = (uchar)255;
istaken[mainindex] = true; istaken[mainindex] = true;
} }
mainindex++; 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