IPSDK 0.2
IPSDK : Image Processing Software Development Kit
Super Pixels 2dSee full documentation
imagesuperPixels2dImg (inImg,inSuperPixelsParamValue,inCompactness,inNbIter)
imagesuperPixels2dImg (inImg,inSuperPixelsParamValue,inCompactness,inNbIter,inOptSizeRatio,inOptSuperPixelsType)

Detailed Description

function for computing super pixels

The super pixels algorithm is based on the SILC method (Simple Linear Iterative Clustering)

See also
https://darshita1405.medium.com/superpixels-and-slic-6b2d8a6e4f08

This algorithm is used to separate an image into super pixels (group of pixels). Those super pixels are computed to follow the contours of the input image. Each pixel is compared with the center of the closest super pixels, and associated to the most similar one, in term of distance and color.

The following parameters allow to optimise the computation of the super pixels:

Here is an example (number of super pixels : 500, compactness : 0.5, number of iterations : 3, size ratio : 0.5)

superPixels2dImg.png

Example of Python code :

Example imports

import PyIPSDK
import PyIPSDK.IPSDKIPLAdvancedMorphology as advmorpho

Code Example

# opening of input image
inImg = PyIPSDK.loadTiffImageFile(inputImgPath)
# Optional parameters
superPixelsNumber = 500
compactness = 0.5
nbIter = 3
sizeRatio = 0.5
superPixelsType = PyIPSDK.eSPT_Number
outImg = advmorpho.superPixels2dImg(inImg, superPixelsNumber, compactness, nbIter, sizeRatio,superPixelsType)

Example of C++ code :

Example informations

Header file

#include <IPSDKIPL/IPSDKIPLAdvancedMorphology/Processor/SuperPixels2dImg/SuperPixels2dImg.h>

Code Example

ImagePtr pInImg = loadTiffImageFile(inputImgPath);
ImagePtr pOutBinLabImg = superPixels2dImg(pInImg, 500,0.5,3);