Merge pull request #483 from cbalint13:slic_lsc

pull/494/head
Alexander Alekhin 9 years ago
commit df56f27e4f
  1. 6
      modules/ximgproc/src/lsc.cpp
  2. 2
      modules/ximgproc/src/seeds.cpp
  3. 6
      modules/ximgproc/src/slic.cpp

@ -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++;

Loading…
Cancel
Save