public class Keypoint extends Object implements Serializable, ScaleSpacePoint, LocalFeature<KeypointLocation,ByteFV>, VariableLength, Cloneable
Modifier and Type | Field and Description |
---|---|
byte[] |
ivec
keypoint feature descriptor (i.e.
|
float |
ori
dominant orientation of keypoint
|
float |
scale
scale of keypoint
|
float |
x
x-position of keypoint
|
float |
y
y-position of keypoint
|
Constructor and Description |
---|
Keypoint()
Construct with the default feature vector length for SIFT (128).
|
Keypoint(float x,
float y,
float ori,
float scale,
byte[] ivec)
Construct with the given parameters.
|
Keypoint(int length)
Construct with the given feature vector length.
|
Keypoint(Keypoint k)
Construct by copying from another
Keypoint |
Modifier and Type | Method and Description |
---|---|
static List<Keypoint> |
addGaussianNoise(List<Keypoint> siftFeatures,
double mean,
double sigma)
Add Gaussian noise the feature vectors of some features.
|
String |
asciiHeader()
Header for ascii input.
|
byte[] |
binaryHeader()
Header for binary input.
|
Keypoint |
clone() |
Point2d |
copy()
Clone the point
|
void |
copyFrom(Point2d p)
Copy the values of the given point into this point.
|
boolean |
equals(Object obj) |
int |
getDimensions() |
ByteFV |
getFeatureVector()
Get the FeatureVector associated with this object.
|
KeypointLocation |
getLocation()
Get the location associated with this object.
|
Float |
getOrdinate(int dimension)
Get the ordinate value for a specific dimension.
|
static List<Keypoint> |
getRelativeKeypoints(List<Keypoint> keypoints,
float x,
float y)
Create a list of
Keypoint s from the input list, but with the
positions offset by the given amount. |
float |
getScale()
Get the scale associated with this point.
|
static List<Keypoint> |
getScaledKeypoints(List<Keypoint> keypoints,
int toScale)
Scale a list of keypoints by the given amount.
|
float |
getX() |
float |
getY() |
int |
hashCode() |
boolean |
locationEquals(Object obj)
|
Point2d |
minus(Point2d a)
Take point point from another point such that return = this - a
|
void |
readASCII(Scanner in)
Read internal state from in.
|
void |
readBinary(DataInput in)
Read internal state from in.
|
void |
setLocation(KeypointLocation location)
Set the location of this
Keypoint |
void |
setOrdinate(int dimension,
Number value)
Set the ordinate value for a specific dimension.
|
void |
setScale(float scale)
Set the scale associated with this point.
|
void |
setX(float x)
Set x coordinate of point
|
void |
setY(float y)
Set y coordinate of point
|
String |
toString() |
Keypoint |
transform(Jama.Matrix transform)
Transform the point by the given matrix
|
void |
translate(float x,
float y)
Translate the position of the point by the given amounts
|
void |
translate(Point2d v)
Translate the position of the point by the given amounts
|
void |
writeASCII(PrintWriter out)
Write the content of this as ascii to out.
|
void |
writeBinary(DataOutput out)
Write the content of this as binary to out.
|
public byte[] ivec
public float ori
public float scale
public float x
public float y
public Keypoint()
public Keypoint(int length)
length
- the length of the feature vectorpublic Keypoint(float x, float y, float ori, float scale, byte[] ivec)
x
- the x-ordinate of the keypointy
- the y-ordinate of the keypointori
- the orientation of the keypointscale
- the scale of the keypointivec
- the feature vector of the keypointpublic Float getOrdinate(int dimension)
Coordinate
getOrdinate
in interface Coordinate
dimension
- The index of the dimension we are interested inpublic int getDimensions()
getDimensions
in interface Coordinate
public float getScale()
ScaleSpacePoint
getScale
in interface ScaleSpacePoint
public void setScale(float scale)
ScaleSpacePoint
setScale
in interface ScaleSpacePoint
scale
- the scale to set.public boolean locationEquals(Object obj)
obj
- the other keypointpublic void copyFrom(Point2d p)
Point2d
public void writeBinary(DataOutput out) throws IOException
WriteableBinary
writeBinary
in interface WriteableBinary
out
- sink to write toIOException
- an error writing to outpublic void writeASCII(PrintWriter out) throws IOException
WriteableASCII
writeASCII
in interface WriteableASCII
out
- sink to write toIOException
- an error writing to outpublic void readBinary(DataInput in) throws IOException
ReadableBinary
readBinary
in interface ReadableBinary
in
- source to read from.IOException
- an error reading inputpublic void readASCII(Scanner in) throws IOException
ReadableASCII
readASCII
in interface ReadableASCII
in
- source to read from.IOException
- an error reading inputpublic byte[] binaryHeader()
ReadableBinary
binaryHeader
in interface ReadableBinary
binaryHeader
in interface WriteableBinary
public String asciiHeader()
ReadableASCII
asciiHeader
in interface ReadableASCII
asciiHeader
in interface WriteableASCII
public ByteFV getFeatureVector()
FeatureVectorProvider
getFeatureVector
in interface FeatureVectorProvider<ByteFV>
public KeypointLocation getLocation()
LocationProvider
getLocation
in interface LocationProvider<KeypointLocation>
public void setLocation(KeypointLocation location)
Keypoint
location
- the locationpublic static List<Keypoint> getRelativeKeypoints(List<Keypoint> keypoints, float x, float y)
Keypoint
s from the input list, but with the
positions offset by the given amount.keypoints
- the input listx
- the x offsety
- the y offsetpublic static List<Keypoint> addGaussianNoise(List<Keypoint> siftFeatures, double mean, double sigma)
siftFeatures
- the input featuresmean
- the mean of the noisesigma
- the standard deviation of the noisepublic static List<Keypoint> getScaledKeypoints(List<Keypoint> keypoints, int toScale)
keypoints
- the input features.toScale
- the scale factorpublic void translate(float x, float y)
Point2d
public Keypoint transform(Jama.Matrix transform)
Point2d
public Point2d minus(Point2d a)
Point2d
public void translate(Point2d v)
Point2d
public void setOrdinate(int dimension, Number value)
Coordinate
setOrdinate
in interface Coordinate
dimension
- The index of the dimension we are interested invalue
- The value of the ordinate of the given dimension.