How do we know what are the superpixels connected to each other ?
3 visualizzazioni (ultimi 30 giorni)
Mostra commenti meno recenti
I am using SLIC superpixel algorithm. How to create adjacency matrix for superpixels? How do we know what are the superpixels connected to each other?
Thanks in advance
0 Commenti
Risposte (2)
Image Analyst
il 23 Apr 2017
You can use GLCM - the Gray Level Cooccurrence Matrix, done by graycomatrix(). It tells you which gray levels are next to which other gray levels. I attached a demo.
2 Commenti
Image Analyst
il 23 Apr 2017
You don't need the stats. Just look at the matrix and see what locations have non-zero pixel pair counts. It says what label is next to what other label.
2 is next to 3, 4, 5, and 6
3 is next to 2, 4, 5, 6, and 7
4 is next to 2, 3, 5, and 6
and so on.
Casio Uploader
il 9 Giu 2018
Modificato: Casio Uploader
il 9 Giu 2018
glcms=graycomatrix(L); % 'L' is Labled Image output of SLIC superpixel algorithm
kkkk=glcms(:,SupNum); %if you want to find neibours of 1,then input SupNum=1 in both places
[rrrr,~]=find(kkkk>0); aa=find(rrrr==SupNum);
rrrr(aa)=[];
%%rrrr is output matrix which contains the neighbours of 1(or your desired one)
N.B.:It will give you just right directions neighbour information,to get all direction use 'Offset' optiom for graycomatrix() function.See: https://in.mathworks.com/help/images/ref/graycomatrix.html
0 Commenti
Vedere anche
Prodotti
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!