public class SIFTGeoKeypoint extends Object implements LocalFeature<SIFTGeoKeypoint.SIFTGeoLocation,ByteFV>, VariableLength, Cloneable, Serializable
LocalFeature
based on the .siftgeo format
developed by Krystian Mikolajczyk for his tools.
Because the .siftgeo file-format is custom, it isn't directly compatible with
that read by
MemoryLocalFeatureList.read(java.io.BufferedInputStream, Class)
or
written with IOUtils
. To work-around these issues, this class
implements a set of static I/O methods for reading and writing multiple
features to/from a standard .siftgeo file.
Modifier and Type | Class and Description |
---|---|
class |
SIFTGeoKeypoint.SIFTGeoLocation
The location of a
SIFTGeoKeypoint . |
Modifier and Type | Field and Description |
---|---|
byte[] |
descriptor
The descriptor
|
SIFTGeoKeypoint.SIFTGeoLocation |
location
The location of the point
|
Constructor and Description |
---|
SIFTGeoKeypoint(float x,
float y,
float orientation,
float scale,
float cornerness,
Jama.Matrix affine,
byte[] descriptor)
Construct with the given parameters
|
SIFTGeoKeypoint(int len)
Construct with the location set to zero, and with an empty descriptor of
the given length.
|
Modifier and Type | Method and Description |
---|---|
String |
asciiHeader()
Header for ascii input.
|
byte[] |
binaryHeader()
Header for binary input.
|
ByteFV |
getFeatureVector()
Get the FeatureVector associated with this object.
|
SIFTGeoKeypoint.SIFTGeoLocation |
getLocation()
Get the location associated with this object.
|
static LocalFeatureList<SIFTGeoKeypoint> |
read(DataInputStream stream)
Read .siftgeo file from a stream.
|
static LocalFeatureList<SIFTGeoKeypoint> |
read(File file)
Read a .siftgeo file.
|
static LocalFeatureList<SIFTGeoKeypoint> |
read(InputStream stream)
Read .siftgeo file from a stream.
|
void |
readASCII(Scanner in)
Read internal state from in.
|
void |
readBinary(DataInput in)
Read internal state from in.
|
String |
toString() |
static void |
write(List<SIFTGeoKeypoint> keys,
DataOutputStream stream)
Write a .siftgeo stream
|
static void |
write(List<SIFTGeoKeypoint> keys,
File file)
Write a .siftgeo file
|
static void |
write(List<SIFTGeoKeypoint> keys,
OutputStream stream)
Write a .siftgeo stream
|
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 SIFTGeoKeypoint.SIFTGeoLocation location
public byte[] descriptor
public SIFTGeoKeypoint(int len)
len
- the descriptor lengthpublic SIFTGeoKeypoint(float x, float y, float orientation, float scale, float cornerness, Jama.Matrix affine, byte[] descriptor)
x
- x-ordinate of featurey
- y-ordinate of featurescale
- scale of featureorientation
- orientation of featurecornerness
- the saliency of the interest pointaffine
- affine parametersdescriptor
- the descriptorpublic void readASCII(Scanner in) throws IOException
ReadableASCII
readASCII
in interface ReadableASCII
in
- source to read from.IOException
- an error reading inputpublic String asciiHeader()
ReadableASCII
asciiHeader
in interface ReadableASCII
asciiHeader
in interface WriteableASCII
public void readBinary(DataInput in) throws IOException
ReadableBinary
readBinary
in interface ReadableBinary
in
- source to read from.IOException
- an error reading inputpublic byte[] binaryHeader()
ReadableBinary
binaryHeader
in interface ReadableBinary
binaryHeader
in interface WriteableBinary
public void writeASCII(PrintWriter out) throws IOException
WriteableASCII
writeASCII
in interface WriteableASCII
out
- sink to write toIOException
- an error writing to outpublic void writeBinary(DataOutput out) throws IOException
WriteableBinary
writeBinary
in interface WriteableBinary
out
- sink to write toIOException
- an error writing to outpublic ByteFV getFeatureVector()
FeatureVectorProvider
getFeatureVector
in interface FeatureVectorProvider<ByteFV>
public SIFTGeoKeypoint.SIFTGeoLocation getLocation()
LocationProvider
getLocation
in interface LocationProvider<SIFTGeoKeypoint.SIFTGeoLocation>
public static LocalFeatureList<SIFTGeoKeypoint> read(File file) throws IOException
file
- the fileSIFTGeoKeypoint
sIOException
- if an error occurs during readingpublic static LocalFeatureList<SIFTGeoKeypoint> read(InputStream stream) throws IOException
stream
- the streamSIFTGeoKeypoint
sIOException
- if an error occurs during readingpublic static LocalFeatureList<SIFTGeoKeypoint> read(DataInputStream stream) throws IOException
stream
- the streamSIFTGeoKeypoint
sIOException
- if an error occurs during readingpublic static void write(List<SIFTGeoKeypoint> keys, File file) throws IOException
keys
- the SIFTGeoKeypoint
s to writefile
- the fileIOException
- if an error occurs whilst writingpublic static void write(List<SIFTGeoKeypoint> keys, OutputStream stream) throws IOException
keys
- the SIFTGeoKeypoint
s to writestream
- the streamIOException
- if an error occurs whilst writingpublic static void write(List<SIFTGeoKeypoint> keys, DataOutputStream stream) throws IOException
keys
- the SIFTGeoKeypoint
s to writestream
- the streamIOException
- if an error occurs whilst writing