View Javadoc

1   /*
2    * @(#)$Id: F19.java 689 2009-07-22 00:10:27Z bsigner $
3    *
4    * Author       :   Ueli Kurmann, igesture@uelikurmann.ch
5    *
6    * Purpose      :   Feature representing the proportion start/end-point
7    *                  to the diagonal of the bounding box.
8    *
9    * -----------------------------------------------------------------------
10   *
11   * Revision Information:
12   *
13   * Date             Who         Reason
14   *
15   * Dec 26, 2006     ukurmann    Initial Release
16   * Mar 15, 2007     bsigner     Cleanup
17   * Jul 24, 2007     bsigner     Renamed from F20 to F19
18   *
19   * -----------------------------------------------------------------------
20   *
21   * Copyright 1999-2009 ETH Zurich. All Rights Reserved.
22   *
23   * This software is the proprietary information of ETH Zurich.
24   * Use is subject to license terms.
25   * 
26   */
27  
28  
29  package org.ximtec.igesture.algorithm.feature;
30  
31  import org.sigtec.ink.Note;
32  
33  
34  /**
35   * Feature representing the proportion start/end-point to the diagonal of the
36   * bounding box.
37   * 
38   * @version 1.0 Dec 2006
39   * @author Ueli Kurmann, igesture@uelikurmann.ch
40   * @author Beat Signer, signer@inf.ethz.ch
41   */
42  public class F19 implements Feature {
43  
44     private static final int MINIMAL_NUMBER_OF_POINTS = 2;
45  
46  
47     public double compute(Note note) throws FeatureException {
48        if (note.getPoints().size() < MINIMAL_NUMBER_OF_POINTS) {
49           throw new FeatureException(FeatureException.NOT_ENOUGH_POINTS);
50        }
51  
52        return new F5().compute(note) / new F3().compute(note);
53     } // compute
54  
55  
56     public int getMinimalNumberOfPoints() {
57        return MINIMAL_NUMBER_OF_POINTS;
58     } // getMinimalNumberOfPoints
59  
60  }