How do we know what are the superpixels connected to each other ?

조회 수: 3 (최근 30일)
Ad
Ad 2017년 4월 23일
편집: Casio Uploader 2018년 6월 9일
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

답변 (2개)

Image Analyst
Image Analyst 2017년 4월 23일
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
Ad
Ad 2017년 4월 23일
I have used GLCM. I got result like this.
graystats.Correlation,0.056197194015968
graystats.Energy,0.985076430158353
graystats.Homogeneity,0.245757011433993;
graystats.Contrast,0.992415460185401
Q. How do I know the connected superpixels?
GLCMS2= graycomatrix(rgbtogray);% it is accepting 2D images only
graystats = graycoprops(GLCMS2,{'all'});
Image Analyst
Image Analyst 2017년 4월 23일
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
Casio Uploader 2018년 6월 9일
편집: Casio Uploader 2018년 6월 9일
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

카테고리

Help CenterFile Exchange에서 Images에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by