How to know each pixel of a superpixel in MatLab?

1

I'm doing a program in MatLab using the computer vision addon. I used the superpixels function to get the array of labels. From what I understand this matrix represents which label (superpixel) each pixel of the image belongs to. But there's something I do not understand.

This label array should be the same size as the original image, but when you check the row and column values for each, a different column value appears.

I'm doing this:

I = imread('barco3.jpg');
figure
imshow(I)
[l,c] = size(I);
[L,N] = superpixels(I,500);
[m,n] = size(L);

And when I see the values of l, c, m, n different values appear between c and n (columns of the original image and the label matrix L)

l = 331  
c = 1500
m = 331
n = 500

Does anyone know why? And how can I find out which superpixel each pixel of an image belongs to?

    
asked by anonymous 26.10.2017 / 23:44

1 answer

0

I discovered the reason, hehe! The image is colored, so the array stores the information for R, G and B together.

    
20.07.2018 / 01:09