How to know each pixel of a superpixel in Matlab?

Asked

Viewed 78 times

1

I am doing a program in Matlab using the computer vision addon. I used the superpixel function to get the array of Abels. From what I understand this matrix represents which label (superpixel) each pixel of the image belongs to. However, there is something that I am not understanding.

This label matrix should be the same size as the original image however when checking the line and column values of each one, a different column value appears.

I am doing it:

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 there are different values between c and n (columns of the original image and the L label matrix)

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?

1 answer

0


I found the reason, hehe! The image is colored, so the matrix keeps the information for R, G and B together.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.