« View all new features in
Mathematica
9
◄
previous
|
next
►
New in
Mathematica
9
›
Advanced Image Processing with Large Image Support
Similarity Graph of Images Using Earth Mover Distance
In[1]:=
In[2]:=
X
distances = Table[ ImageDistance[l[[i]], l[[j]], DistanceFunction -> "EarthMoverDistance"], {i, 1, Length@l}, {j, i + 1, Length@l}];
In[3]:=
X
mtemp = PadLeft[#, Length[l]] & /@ distances; distmatrix = mtemp + Transpose[mtemp];
In[4]:=
X
adjmatrix = 1 - Unitize[ Threshold[distmatrix, Quantile[Flatten[distances], 1/4]]]; GraphPlot[adjmatrix, VertexRenderingFunction -> (Inset[l[[#2]], #, Center, .5] &), SelfLoopStyle -> None, Method -> "SpringEmbedding", ImageSize -> 500]
Out[4]=