how can I view each individual superpixel?

6 Ansichten (letzte 30 Tage)
Sai V
Sai V am 21 Apr. 2017
Beantwortet: Image Analyst am 14 Dez. 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 Kommentar
Sumit
Sumit am 14 Dez. 2023
Can you share the code for SLIC and is your problem resolved?

Melden Sie sich an, um zu kommentieren.

Antworten (1)

Image Analyst
Image Analyst am 14 Dez. 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!

Translated by