Commit 6241296f authored by Balint Cristian's avatar Balint Cristian

Allow vector<Mat> raster bands to SEEDS.

parent 46dd2631
......@@ -375,7 +375,31 @@ void SuperpixelSEEDSImpl::initImageBins<float>(const Mat& img, int)
void SuperpixelSEEDSImpl::initImage(InputArray img)
{
Mat src = img.getMat();
Mat src;
if ( img.isMat() )
{
// get Mat
src = img.getMat();
// image should be valid
CV_Assert( !src.empty() );
}
else if ( img.isMatVector() )
{
vector<Mat> vec;
// get vector Mat
img.getMatVector( vec );
// array should be valid
CV_Assert( !vec.empty() );
// merge into Mat
merge( vec, src );
}
else
CV_Error( Error::StsInternal, "Invalid InputArray." );
int depth = src.depth();
seeds_current_level = seeds_nr_levels - 2;
forwardbackward = true;
......
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