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 { 038 pt = new Point(x, y); 039 size = _size; 040 angle = _angle; 041 response = _response; 042 octave = _octave; 043 class_id = _class_id; 044 } 045 046 // javadoc: KeyPoint::KeyPoint() 047 public KeyPoint() 048 { 049 this(0, 0, 0, -1, 0, 0, -1); 050 } 051 052 // javadoc: KeyPoint::KeyPoint(x, y, _size, _angle, _response, _octave) 053 public KeyPoint(float x, float y, float _size, float _angle, float _response, int _octave) 054 { 055 this(x, y, _size, _angle, _response, _octave, -1); 056 } 057 058 // javadoc: KeyPoint::KeyPoint(x, y, _size, _angle, _response) 059 public KeyPoint(float x, float y, float _size, float _angle, float _response) 060 { 061 this(x, y, _size, _angle, _response, 0, -1); 062 } 063 064 // javadoc: KeyPoint::KeyPoint(x, y, _size, _angle) 065 public KeyPoint(float x, float y, float _size, float _angle) 066 { 067 this(x, y, _size, _angle, 0, 0, -1); 068 } 069 070 // javadoc: KeyPoint::KeyPoint(x, y, _size) 071 public KeyPoint(float x, float y, float _size) 072 { 073 this(x, y, _size, -1, 0, 0, -1); 074 } 075 076 @Override 077 public String toString() { 078 return "KeyPoint [pt=" + pt + ", size=" + size + ", angle=" + angle 079 + ", response=" + response + ", octave=" + octave 080 + ", class_id=" + class_id + "]"; 081 } 082 083}