how can I view each individual superpixel?

5 views (last 30 days)
Sai V
Sai V on 21 Apr 2017
Answered: Image Analyst on 14 Dec 2023
I have performed SLIC algorithm. I want to view each individual pixel and what are the superpixels connected to each other ?
Thank you
  1 Comment
Sumit
Sumit on 14 Dec 2023
Can you share the code for SLIC and is your problem resolved?

Sign in to comment.

Answers (1)

Image Analyst
Image Analyst on 14 Dec 2023
The superpixels algorithm gives you the labeled image, where each superpixel is assigned an ID number. To view them all you could do this
numregions = max(labeledImage);
for k = 1 : numregions
thisRegion = ismember(labeledImage, k);
imshow(thisRegion);
% Pause a bit for you to see it.
pause(0.5);
end
To see which regions are adjacent, you can use graycomatrix to give the gray level co-occurrence matrix. It will tell you which labels are right next to each other. I'm attaching a demo for that function.

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!