hhreco.recognition
Class ZernikeFE

java.lang.Object
  extended byhhreco.recognition.ZernikeFE
All Implemented Interfaces:
FeatureExtractor

public class ZernikeFE
extends java.lang.Object
implements FeatureExtractor

Compute Zernike moments of the specified order [1]. This is a global feature of a shape and is independent of stroke-number, -order, and -direction. This feature (specifically the magnitude of the moment) is invariant to rotation, but not invariant to scale and translation. Therefore, it is important to normalize the shape before extracting the moment features. All moment features up to the specified order are returned except for order 0 and 1. This is because for shapes that have been scale- and translation- normalized, these values are the same across all shapes and therefore they are not useful for distinguishing shapes. If desired, one can call zer_mom directly to obtain these moment values.

[1] 'A. Khotanzad and Y.H. Hong' "Invariant image recognition by Zernike Moments", IEEE trans. on Pattern Analysis and Machine Intelligence, vol.12, no.5, pp.489-487, May 1990.


Field Summary
static int DEFAULT_ORDER
          The default order of Zernike moments is set to 8.
 
Constructor Summary
ZernikeFE()
          Create a Zernike feature extractor with the default order.
ZernikeFE(int order)
          Create a Zernike feature extractor with the specified order.
 
Method Summary
 double[] apply(TimedStroke[] s)
          Return the magnitudes of the Zernike moments of the default order.
 double[] apply(TimedStroke[] s, int order)
          Return the magnitudes of the Zernike moments of the specified order.
 java.lang.String getName()
          Return the name of this feature extractor.
 int getOrder()
          Return the moment order.
 void setOrder(int order)
          Set the moment order (appears as 'n' in the equations [1])
static double[] zernikeMoments(TimedStroke[] s)
          Compute Zernike moments of the stroke.
static double[] zernikeMoments(TimedStroke[] s, int order)
          Compute Zernike moments of the specified order and return the magnitudes of the moments.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DEFAULT_ORDER

public static int DEFAULT_ORDER
The default order of Zernike moments is set to 8. This will compute moments from order 2 up to order 8.

Constructor Detail

ZernikeFE

public ZernikeFE()
Create a Zernike feature extractor with the default order.


ZernikeFE

public ZernikeFE(int order)
Create a Zernike feature extractor with the specified order.

Method Detail

apply

public double[] apply(TimedStroke[] s)
Return the magnitudes of the Zernike moments of the default order.

Specified by:
apply in interface FeatureExtractor

apply

public double[] apply(TimedStroke[] s,
                      int order)
Return the magnitudes of the Zernike moments of the specified order.


setOrder

public void setOrder(int order)
Set the moment order (appears as 'n' in the equations [1])


getOrder

public int getOrder()
Return the moment order.


getName

public java.lang.String getName()
Return the name of this feature extractor.

Specified by:
getName in interface FeatureExtractor

zernikeMoments

public static double[] zernikeMoments(TimedStroke[] s)
Compute Zernike moments of the stroke.


zernikeMoments

public static double[] zernikeMoments(TimedStroke[] s,
                                      int order)
Compute Zernike moments of the specified order and return the magnitudes of the moments.