SMIL  1.0.4
Images Similarity

Detailed Description

This module provides functions to evaluate the similarity between two images. The main usage may be to validate algorithms when comparing results of some algorithm against what is expected (the Ground Truth)

The following conventions are used in the definition of some indices for binary images :

See also
+ Collaboration diagram for Images Similarity:

Functions

template<typename T >
double indexJaccard (const Image< T > &imGt, const Image< T > &imIn)
 indexJaccard() More...
 
template<typename T >
double indexRuzicka (const Image< T > &imGt, const Image< T > &imIn)
 indexRuzicka() More...
 
template<typename T >
double indexAccuracy (const Image< T > &imGt, const Image< T > &imIn, const T threshold=0)
 indexAccuracy() More...
 
template<typename T >
double indexPrecision (const Image< T > &imGt, const Image< T > &imIn)
 indexPrecision() More...
 
template<typename T >
double indexRecall (const Image< T > &imGt, const Image< T > &imIn)
 indexRecall() More...
 
template<typename T >
double indexFScore (const Image< T > &imGt, const Image< T > &imIn, const double beta=1.)
 indexFScore() More...
 
template<typename T >
double indexSensitivity (const Image< T > &imGt, const Image< T > &imIn)
 indexSensitivity() More...
 
template<typename T >
double indexSpecificity (const Image< T > &imGt, const Image< T > &imIn)
 indexSpecificity() More...
 
template<typename T >
double indexFallOut (const Image< T > &imGt, const Image< T > &imIn)
 indexFallOut() More...
 
template<typename T >
double indexMissRate (const Image< T > &imGt, const Image< T > &imIn)
 indexMissRate() More...
 
template<typename T >
double indexOverlap (const Image< T > &imGt, const Image< T > &imIn)
 indexOverlap() More...
 
template<typename T >
size_t distanceHamming (const Image< T > &imGt, const Image< T > &imIn)
 distanceHamming() More...
 
template<typename T >
double distanceHausdorff (const Image< T > &imGt, const Image< T > &imIn)
 distanceHausdorff() - More...
 

Function Documentation

◆ indexJaccard()

double smil::indexJaccard ( const Image< T > &  imGt,
const Image< T > &  imIn 
)

indexJaccard()

  • for binary images, this function returns the Jaccard similarity coefficient defined by :

    \[ Jaccard(imGt, imIn) = \dfrac{|imGt \cap imIn|}{\vert imGt \cup imIn \vert} = \dfrac{area(logicAnd(imGt, \; imIn))}{area(logicOr(imGt, \; imIn))} \]

  • for non binary images, this function returns the Weighted Jaccard similarity coefficient, also known as Ruzicka coefficient - see indexRuzicka()
See also
Parameters
[in]imGt: Ground Truth image
[in]imIn: image to verify
Returns
returns Jaccard similarity index between two images

◆ indexRuzicka()

double smil::indexRuzicka ( const Image< T > &  imGt,
const Image< T > &  imIn 
)

indexRuzicka()

Returns the Weighted Jaccard similarity coefficient, also known as Ruzicka coefficient - see indexJaccard()

\[ Ruzicka(imGt, imIn) = \dfrac{\sum_{p} min(imGt(p), \; imIn(p))} {\sum_{p} max(imGt(p), \; imIn(p))} = \dfrac{volume(inf(imGt, \; imIn))} {volume(sup(imGt, \; imIn))} \]

See also
Parameters
[in]imGt: Ground Truth image
[in]imIn: image to verify
Returns
returns Ruzicka similarity index between two images

◆ indexAccuracy()

double smil::indexAccuracy ( const Image< T > &  imGt,
const Image< T > &  imIn,
const T  threshold = 0 
)

indexAccuracy()

Returns the Rand Index, also called Accuracy or Simple matching coefficient

  • For binary images (see isBinary()) this value is evaluated as :

    \[ Accuracy(imGt, imIn) = \dfrac{TP + TN}{TP + FP + TN + FN} \]

  • for non binary images, pixels values are considered to be equal if their difference is not greater than threshold
See also
Parameters
[in]imGt: Ground Truth image
[in]imIn: image to verify
[in]threshold: difference between pixels accepted as equality.
Returns
the Accuracy index between two images

◆ indexPrecision()

double smil::indexPrecision ( const Image< T > &  imGt,
const Image< T > &  imIn 
)

indexPrecision()

Returns, for binary images (see isBinary()), the Precision index, also called Positive prediction value

\[ Precision(imGt, imIn) = \dfrac{TP}{TP + FP} \]

See also
Note
  • only binary images (two classes)
Parameters
[in]imGt: Ground Truth image
[in]imIn: image to verify
Returns
returns Precision index between two images

◆ indexRecall()

double smil::indexRecall ( const Image< T > &  imGt,
const Image< T > &  imIn 
)

indexRecall()

Returns, for binary images (see isBinary()), the Recall index, also called Sensitivity or Hit rate or True Positive Rate

\[ Recall(imGt, imIn) = \dfrac{TP}{TP + FN} \]

See also
Note
  • only binary images (two classes)
Parameters
[in]imGt: Ground Truth image
[in]imIn: image to verify
Returns
returns Recall index between two images

◆ indexFScore()

double smil::indexFScore ( const Image< T > &  imGt,
const Image< T > &  imIn,
const double  beta = 1. 
)

indexFScore()

Returns, for binary images (see isBinary()), the F-Score between two images.

\[ F_\beta(imGt, imIn) = (1 + \beta^2) . \dfrac{Precision \; . \; Recall} {\beta^2 \; . \; Precision + Recall} \]

See also
Note
  • only binary images (two classes)
Parameters
[in]imGt: Ground Truth image
[in]imIn: image to verify
[in]beta: $ \beta $ coefficient (default value : 1.)
Returns
returns F-Score index between two images

◆ indexSensitivity()

double smil::indexSensitivity ( const Image< T > &  imGt,
const Image< T > &  imIn 
)

indexSensitivity()

Returns, for binary images (see isBinary()), the Sensitivity, also called Recall, Hit rate or True Positive Rate

\[ Sensitivity(imGt, imIn) = \dfrac{TP}{TP+FN} \]

See also
Note
  • only binary images (two classes)
Parameters
[in]imGt: Ground Truth image
[in]imIn: image to verify
Returns
returns Sensitivity index between two images

◆ indexSpecificity()

double smil::indexSpecificity ( const Image< T > &  imGt,
const Image< T > &  imIn 
)

indexSpecificity()

Returns, for binary images (see isBinary()), the Specificity index, also called Selectivity or True negative rate

\[ Specificity(imGt, imIn) = \dfrac{TN}{TN+FP} \]

See also
Note
  • only binary images (two classes)
Parameters
[in]imGt: Ground Truth image
[in]imIn: image to verify
Returns
returns Specificity index between two images

◆ indexFallOut()

double smil::indexFallOut ( const Image< T > &  imGt,
const Image< T > &  imIn 
)

indexFallOut()

Returns, for binary images (see isBinary()), the Fall Out index, also called False positive rate or False alarm rate

\[ Fallout(imGt, imIn) = \dfrac{FP}{TN+FP} \]

See also
Note
  • only binary images (two classes)
Parameters
[in]imGt: Ground Truth image
[in]imIn: image to verify
Returns
returns FallOut index between two images

◆ indexMissRate()

double smil::indexMissRate ( const Image< T > &  imGt,
const Image< T > &  imIn 
)

indexMissRate()

Returns, for binary images (see isBinary()), the Miss Rate index, also called False negative rate

\[ MissRate(imGt, imIn) = \dfrac{FN}{TP+FN} \]

See also
Note
  • only binary images (two classes)
Parameters
[in]imGt: Ground Truth image
[in]imIn: image to verify
Returns
returns MissRate index between two images

◆ indexOverlap()

double smil::indexOverlap ( const Image< T > &  imGt,
const Image< T > &  imIn 
)

indexOverlap()

Returns, for binary images (see isBinary()), the Overlap coefficient

\[ Overlap(imGt, imIn) = \dfrac{|imGt \cap imIn|}{min(|imGt|, |imIn|)} = \dfrac{area(inf(imGt, imIn))} {min(area(imGt), area(imIn))} \]

See also
Note
  • only binary images (two classes)
Parameters
[in]imGt: Ground Truth image
[in]imIn: image to verify
Returns
returns Overlap index between two images

◆ distanceHamming()

size_t smil::distanceHamming ( const Image< T > &  imGt,
const Image< T > &  imIn 
)

distanceHamming()

Returns the number of pixels with different values in the two images.

See also
Parameters
[in]imGt: Ground Truth image
[in]imIn: image to verify
Returns
returns Hamming distance between two images

◆ distanceHausdorff()

double smil::distanceHausdorff ( const Image< T > &  imGt,
const Image< T > &  imIn 
)

distanceHausdorff() -

See also
Note
  • only binary images (two classes)
Parameters
[in]imGt: Ground Truth image
[in]imIn: image to verify
Returns
returns Hausdorff distance between two images