Tuesday, June 25, 2013

VL_SLIC gives disjointed superpixels!!! Is it a bug?

I used vl_slic to oversegment the following image.
I tried both using the RGB image and LAB image for superpixel segmentation.
Strangely, I find some superpixels which are disconnected regions, instead of whole regions!! I do not know why, if it is a bug in my own way of giving inputs or it is an actual bug.

Here is my command for segmentation:

% Read the RGB image
fileName = [num2str(imgInd) '_rgb'];
load(sprintf(imgFile, imgInd),'imgRgb');
rgbImg = im2double(imgRgb);

% % For LAB colorspace
 regionSize  = 30; %25 ;
 regularizer = 30; %50;
 imglab =  vl_xyz2lab(vl_rgb2xyz(single(img))) ;
 structSuperpix(1).segments = vl_slic(single(imglab), regionSize, regularizer);

% For RGB colorspace
regionSize  = 25;%30;
regularizer = 0.008;%0.01;
structSuperpix(1).segments = vl_slic(single(img), regionSize, regularizer);

The input Image:


Broken superpixel  using LAB image:

Broken superpixel  using RGB image:

Moreover, I need to provide different values of regularizer for equivalent shaped superpixels. Superpixels obtained with LAB colorspace appear more irregular than that using RGB colorspace.

What might be the reason?

No comments:

Post a Comment