001package org.opencv.core;
002
003import org.opencv.core.Point;
004
005//javadoc: KeyPoint
006public class KeyPoint {
007
008    /**
009     * Coordinates of the keypoint.
010     */
011    public Point pt;
012    /**
013     * Diameter of the useful keypoint adjacent area.
014     */
015    public float size;
016    /**
017     * Computed orientation of the keypoint (-1 if not applicable).
018     */
019    public float angle;
020    /**
021     * The response, by which the strongest keypoints have been selected. Can
022     * be used for further sorting or subsampling.
023     */
024    public float response;
025    /**
026     * Octave (pyramid layer), from which the keypoint has been extracted.
027     */
028    public int octave;
029    /**
030     * Object ID, that can be used to cluster keypoints by an object they
031     * belong to.
032     */
033    public int class_id;
034
035    // javadoc:KeyPoint::KeyPoint(x,y,_size,_angle,_response,_octave,_class_id)
036    public KeyPoint(float x, float y, float _size, float _angle, float _response, int _octave, int _class_id) {
037        pt = new Point(x, y);
038        size = _size;
039        angle = _angle;
040        response = _response;
041        octave = _octave;
042        class_id = _class_id;
043    }
044
045    // javadoc: KeyPoint::KeyPoint()
046    public KeyPoint() {
047        this(0, 0, 0, -1, 0, 0, -1);
048    }
049
050    // javadoc: KeyPoint::KeyPoint(x, y, _size, _angle, _response, _octave)
051    public KeyPoint(float x, float y, float _size, float _angle, float _response, int _octave) {
052        this(x, y, _size, _angle, _response, _octave, -1);
053    }
054
055    // javadoc: KeyPoint::KeyPoint(x, y, _size, _angle, _response)
056    public KeyPoint(float x, float y, float _size, float _angle, float _response) {
057        this(x, y, _size, _angle, _response, 0, -1);
058    }
059
060    // javadoc: KeyPoint::KeyPoint(x, y, _size, _angle)
061    public KeyPoint(float x, float y, float _size, float _angle) {
062        this(x, y, _size, _angle, 0, 0, -1);
063    }
064
065    // javadoc: KeyPoint::KeyPoint(x, y, _size)
066    public KeyPoint(float x, float y, float _size) {
067        this(x, y, _size, -1, 0, 0, -1);
068    }
069
070    @Override
071    public String toString() {
072        return "KeyPoint [pt=" + pt + ", size=" + size + ", angle=" + angle
073                + ", response=" + response + ", octave=" + octave
074                + ", class_id=" + class_id + "]";
075    }
076
077}