I would like to extract color, shape and texture features of superpixel segments of an image . Then, I would like to visualize those features in order to select the important features.
I am using the code at this link: https://github.com/np-csu/SLIC-superpixel
I would like to access each cluster of the segmented image like this study: http://www.pyimagesearch.com/2014/12/29/accessing-individual-superpixel-segmentations-python/
However, I couldn' t find the related part of the code.
The method
int* SLIC::GetLabel()
returns the label for each pixel. You can create aMat
header for theint*
for easy access:Then you can create a mask for each superpixel (label):
and retrieve the superpixel in the original image:
Then you can compute whatever statistic you need.
Here the full code for reference: