Function Repository Resource:
ChamferDistance
Measures the Chamfer distance between two point clouds
ResourceFunction["ChamferDistance"][list1,list2] computes the "Chamfer distance" between list1and list2. |
Details and Options
Examples
Basic Examples (2)
Compute the Chamfer distance between two lists:
In[1]:= |
Out[1]= |
Compute the Chamfer distance between two three-dimensional lists (point clouds):
In[2]:= |
Out[2]= |
Options (2)
Set "Definition" to "Sum" to compute the sum of the distances to the nearest points:
In[3]:= |
Out[3]= |
Use the ManhattanDistance to measure the distance between point clouds:
In[4]:= |
Out[4]= |
By changing the distance metric to EditDistance, you can obtain the Chamfer distance between texts:
In[5]:= |
Out[5]= |
By changing the distance metric to GeoDistance, you can obtain the Chamfer distance between two lists of geographic locations:
In[6]:= |
Out[6]= |
ChamferDistance supports the same Method option values as Nearest:
In[7]:= |
Out[7]= |
Applications (1)
See how the Chamfer Distance between the outputs of twoNormal distributions as one changes the mean of one of the distributions:
In[8]:= |
Out[8]= |
Properties and Relations (1)
Changing the order of the points in the point clouds does not affect the Chamfer distance:
In[9]:= |
Out[9]= |
Neat Examples (4)
Create a neural network based on Distilbert that extracts the "meaning" of various passages in texts:
In[10]:= |
Out[10]= |
Map the network onto several sentences from a legal opinion:
In[11]:= |
In[12]:= |
Out[12]= |
Use to find the Chamfer distance between two sets of expressions:
In[13]:= |
Out[13]= |
Get the Chamfer distance between the brightest stars in the constellation Orion and the brightest stars in Ursa Major (a/k/a the Big Dipper). First get the brightest stars in Orion:
In[14]:= |
Out[14]= |
Then get the brightest stars in Ursa Major:
In[15]:= |
Out[15]= |
Compute the Chamfer distance as of January 4, 2023. You need to add QuantityMagnitude to the DistanceFunction pipeline:
In[16]:= |
Out[16]= |
Imagine a tree of all possible concepts (an ontology):
In[17]:= |
Out[17]= |
Compute the distances between concepts in the undirected version of the tree but reduce the dimensionality of the resulting matrix using "MultidimensionalScaling":
In[18]:= |
Out[18]= |
Now imagine seven texts each of which address certain concepts within the tree; each text does not have to address the same number of concepts:
In[19]:= |
Create a DistanceMatrix using the Chamfer distance:
In[20]:= |
Out[20]= |
Construct a nearest neighbor graph:
In[21]:= |
Out[21]= |
Now do a "search" on text 7 to find those texts that are closest to it:
In[22]:= |
Out[22]= |