SOLUTIONS

BUILTIN MATHEMATICA SYMBOL
ImageDistance
ImageDistance[image_{1}, image_{2}]
returns a distance measure between and .
ImageDistance[image_{1}, image_{2}, pos]
places the center of at position pos in .
ImageDistance[image_{1}, image_{2}, pos_{1}, pos_{2}]
places the point of at position in .
Details and OptionsDetails and Options
 ImageDistance[image_{1}, image_{2}] centers in and returns the distance between the overlapping regions in the two images.
 In ImageDistance[image_{1}, image_{2}], and should either have the same number of channels or one should be a singlechannel image. If or is a singlechannel image, the channel is replicated to match the number of channels in the other image.
 ImageDistance accepts a DistanceFunction option. Some typical settings include:

EuclideanDistance Euclidean distance (default) SquaredEuclideanDistance squared Euclidean distance NormalizedSquaredEuclideanDistance normalized squared Euclidean distance ManhattanDistance Manhattan or "city block" distance CosineDistance angular cosine distance CorrelationDistance correlation coefficient distance f function f that is given the overlapping regions of the two images as arguments  The following special settings are also supported:

"MeanEuclideanDistance" mean Euclidean distance "MeanSquaredEuclideanDistance" mean squared Euclidean distance (default) "MeanReciprocalSquaredEuclideanDistance" one minus the mean of the robust distances , where is the Euclidean distance of corresponding pixels "MutualInformationVariation" joint entropy minus mutual information "NormalizedMutualInformationVariation" the mutual information variation divided by the joint entropy "DifferenceNormalizedEntropy" entropy of the difference image "MeanPatternIntensity" mean local pattern intensity difference "GradientCorrelation" mean of the correlation distances between the horizontal and vertical derivatives "MeanReciprocalGradientDistance" one minus the mean of the distances and , where and are the values and and are the variance of the horizontal and vertical derivatives computed for "EarthMoverDistance" earth mover distance  With DistanceFunction>{"MeanReciprocalSquaredEuclideanDistance", }, 1 minus the mean of reciprocal distances is returned. By default, =1.
 With , , , and methods, can be used to specify that n bins should be used in the histogram computation. By default, uses eight bins and all other methods use 256 bins.
 With DistanceFunction>{"MeanPatternIntensity", , r}, the mean of the distances is computed for each pixel in the difference image , where is the Euclidean distance between and pixels in its ranger neighborhood. The overall distance is 1 minus the mean of the local distances. By default, and r=2.
 ImageDistance is symmetric and nonnegative. However, it may not satisfy the triangle inequality. The distance between two images can be 0 with some methods, even if they are not identical.
 If there are no overlapping regions or the measure cannot be determined, ImageDistance returns Indeterminate. »
ExamplesExamplesopen allclose all
Basic Examples (1)Basic Examples (1)
Euclidean distance between two images:
In[1]:= 
Out[1]= 
Mathematica 9 is now available!
New to Mathematica?
Find your learning path »
Have a question?
Ask support »