lib.comparators
Enum Metric

java.lang.Object
  extended by java.lang.Enum<Metric>
      extended by lib.comparators.Metric
All Implemented Interfaces:
java.io.Serializable, java.lang.Comparable<Metric>

public enum Metric
extends java.lang.Enum<Metric>

different metrics to count the distance of two integers representing pixels.

See Also:
distance(int, int), PixelUtils, BufferedImage.getRGB(int, int), BufferedImage.getRGB(int, int, int, int, int[], int, int)

Enum Constant Summary
AE
          absolute error count, number of different pixels (-fuzz effected)
Return 1 if pixels differ, 0 if there is no difference
FUZZ
          mean color distance
MAE
          mean absolute error (normalized), average channel error distance
MEPP
          mean error per pixel (normalized mean error, normalized peak error)
MSE
          mean error squared, average of the channel error squared
{@code MSE = x^2 + y^2 + ...
NCC
          normalized cross correlation
PAE
          peak absolute (normalize peak absolute)
PSNR
          peak signal to noise ratio
RMSE
          root mean squared (normalized root mean squared).
 
Method Summary
 double distance(int a, int b)
           
 double distance(int a, int b, double fuzz)
           
static Metric valueOf(java.lang.String name)
          Returns the enum constant of this type with the specified name.
static Metric[] values()
          Returns an array containing the constants of this enum type, in the order they are declared.
 
Methods inherited from class java.lang.Enum
clone, compareTo, equals, finalize, getDeclaringClass, hashCode, name, ordinal, toString, valueOf
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 

Enum Constant Detail

AE

public static final Metric AE
absolute error count, number of different pixels (-fuzz effected)
Return 1 if pixels differ, 0 if there is no difference


FUZZ

public static final Metric FUZZ
mean color distance


MAE

public static final Metric MAE
mean absolute error (normalized), average channel error distance


MEPP

public static final Metric MEPP
mean error per pixel (normalized mean error, normalized peak error)


MSE

public static final Metric MSE
mean error squared, average of the channel error squared
MSE = x^2 + y^2 + ... + z^2;


NCC

public static final Metric NCC
normalized cross correlation


PAE

public static final Metric PAE
peak absolute (normalize peak absolute)


PSNR

public static final Metric PSNR
peak signal to noise ratio


RMSE

public static final Metric RMSE
root mean squared (normalized root mean squared).
RMSE = Sqrt( x^2 + y^2 + ... + z^2 );

Method Detail

values

public static Metric[] values()
Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:
for (Metric c : Metric.values())
    System.out.println(c);

Returns:
an array containing the constants of this enum type, in the order they are declared

valueOf

public static Metric valueOf(java.lang.String name)
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)

Parameters:
name - the name of the enum constant to be returned.
Returns:
the enum constant with the specified name
Throws:
java.lang.IllegalArgumentException - if this enum type has no constant with the specified name
java.lang.NullPointerException - if the argument is null

distance

public double distance(int a,
                       int b,
                       double fuzz)
Parameters:
a - a pixel to compare to
b - a pixel to compare with
fuzz - color normalization factor
Returns:
the distance between the two integers as defined by the metric
See Also:
Metric, PixelUtils

distance

public double distance(int a,
                       int b)
Parameters:
a - a pixel to compare to
b - a pixel to compare with
Returns:
the distance between the two integers as defined by the metric
See Also:
Metric, PixelUtils