Home | History | Annotate | Download | only in java
      1 package org.opencv.core;
      2 
      3 import org.opencv.core.Point;
      4 
      5 //javadoc: KeyPoint
      6 public class KeyPoint {
      7 
      8     /**
      9      * Coordinates of the keypoint.
     10      */
     11     public Point pt;
     12     /**
     13      * Diameter of the useful keypoint adjacent area.
     14      */
     15     public float size;
     16     /**
     17      * Computed orientation of the keypoint (-1 if not applicable).
     18      */
     19     public float angle;
     20     /**
     21      * The response, by which the strongest keypoints have been selected. Can
     22      * be used for further sorting or subsampling.
     23      */
     24     public float response;
     25     /**
     26      * Octave (pyramid layer), from which the keypoint has been extracted.
     27      */
     28     public int octave;
     29     /**
     30      * Object ID, that can be used to cluster keypoints by an object they
     31      * belong to.
     32      */
     33     public int class_id;
     34 
     35     // javadoc:KeyPoint::KeyPoint(x,y,_size,_angle,_response,_octave,_class_id)
     36     public KeyPoint(float x, float y, float _size, float _angle, float _response, int _octave, int _class_id)
     37     {
     38         pt = new Point(x, y);
     39         size = _size;
     40         angle = _angle;
     41         response = _response;
     42         octave = _octave;
     43         class_id = _class_id;
     44     }
     45 
     46     // javadoc: KeyPoint::KeyPoint()
     47     public KeyPoint()
     48     {
     49         this(0, 0, 0, -1, 0, 0, -1);
     50     }
     51 
     52     // javadoc: KeyPoint::KeyPoint(x, y, _size, _angle, _response, _octave)
     53     public KeyPoint(float x, float y, float _size, float _angle, float _response, int _octave)
     54     {
     55         this(x, y, _size, _angle, _response, _octave, -1);
     56     }
     57 
     58     // javadoc: KeyPoint::KeyPoint(x, y, _size, _angle, _response)
     59     public KeyPoint(float x, float y, float _size, float _angle, float _response)
     60     {
     61         this(x, y, _size, _angle, _response, 0, -1);
     62     }
     63 
     64     // javadoc: KeyPoint::KeyPoint(x, y, _size, _angle)
     65     public KeyPoint(float x, float y, float _size, float _angle)
     66     {
     67         this(x, y, _size, _angle, 0, 0, -1);
     68     }
     69 
     70     // javadoc: KeyPoint::KeyPoint(x, y, _size)
     71     public KeyPoint(float x, float y, float _size)
     72     {
     73         this(x, y, _size, -1, 0, 0, -1);
     74     }
     75 
     76     @Override
     77     public String toString() {
     78         return "KeyPoint [pt=" + pt + ", size=" + size + ", angle=" + angle
     79                 + ", response=" + response + ", octave=" + octave
     80                 + ", class_id=" + class_id + "]";
     81     }
     82 
     83 }
     84