代码
github链接:np-csu/SLIC-superpixel
Class explanation
void SLIC::GenerateSuperpixels(cv::Mat& img, UINT numSuperpixels)Perform SLIC algorithm on the given image with the given number of superpixels.
cv::Mat SLIC::GetImgWithContours(cv::Scalar color)Get the result image with contours on the given color.
int* SLIC::GetLabel()Get label on each pixel which shows the number of superpixel it belongs to.
Example
original image
![]()
200 superpixels
![]()
500 superpixels
![]()
