how can I view each individual superpixel?
5 views (last 30 days)
Show older comments
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
Answers (1)
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.
0 Comments
See Also
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!