L
- The type of Location
public class FloatLocalFeatureAdaptor<L extends Location> extends Object implements LocalFeature<L,FloatFV>
FloatFV
, without the
cost of necessarily storing the underlying feature as a FloatFV
. For
example, this can be used to make a Keypoint look like it's backed by a float
array rather than a byte array, without incurring the four-times increase in
storage this would incur.
The implementation also allows a normalisation process to occur during
conversion through a Normaliser
.
Constructor and Description |
---|
FloatLocalFeatureAdaptor(LocalFeature<L,?> localFeature)
Construct a new
FloatLocalFeatureAdaptor with the given
underlying feature |
FloatLocalFeatureAdaptor(LocalFeature<L,?> localFeature,
Normaliser<FloatFV> normaliser)
Construct a new
FloatLocalFeatureAdaptor with the given
underlying feature and normaliser. |
Modifier and Type | Method and Description |
---|---|
String |
asciiHeader()
Header for ascii input.
|
byte[] |
binaryHeader()
Header for binary input.
|
boolean |
equals(Object obj) |
FloatFV |
getFeatureVector()
Get the FeatureVector associated with this object.
|
L |
getLocation()
Get the location associated with this object.
|
int |
hashCode() |
void |
readASCII(Scanner in)
Read internal state from in.
|
void |
readBinary(DataInput in)
Read internal state from in.
|
static <L extends Location> |
wrap(List<? extends LocalFeature<L,?>> list)
Produce a
LocalFeatureList of FloatLocalFeatureAdaptor by
wrapping the input list, and dynamically wrapping with the
FloatLocalFeatureAdaptor s on demand. |
static <L extends Location> |
wrap(List<? extends LocalFeature<L,?>> list,
Normaliser<FloatFV> normaliser)
Produce a
LocalFeatureList of FloatLocalFeatureAdaptor by
wrapping the input list, and dynamically wrapping with the
FloatLocalFeatureAdaptor s on demand. |
static List<FloatLocalFeatureAdaptor<?>> |
wrapUntyped(List<? extends LocalFeature<?,?>> list)
Produce a
LocalFeatureList of FloatLocalFeatureAdaptor by
wrapping the input list, and dynamically wrapping with the
FloatLocalFeatureAdaptor s on demand. |
static List<FloatLocalFeatureAdaptor<?>> |
wrapUntyped(List<? extends LocalFeature<?,?>> list,
Normaliser<FloatFV> normaliser)
Produce a
LocalFeatureList of FloatLocalFeatureAdaptor by
wrapping the input list, and dynamically wrapping with the
FloatLocalFeatureAdaptor s on demand. |
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 FloatLocalFeatureAdaptor(LocalFeature<L,?> localFeature)
FloatLocalFeatureAdaptor
with the given
underlying featurelocalFeature
- the underlying featurepublic FloatLocalFeatureAdaptor(LocalFeature<L,?> localFeature, Normaliser<FloatFV> normaliser)
FloatLocalFeatureAdaptor
with the given
underlying feature and normaliser.localFeature
- the underlying featurenormaliser
- the normaliserpublic 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 FloatFV getFeatureVector()
FeatureVectorProvider
getFeatureVector
in interface FeatureVectorProvider<FloatFV>
public L getLocation()
LocationProvider
getLocation
in interface LocationProvider<L extends Location>
public static <L extends Location> List<FloatLocalFeatureAdaptor<L>> wrap(List<? extends LocalFeature<L,?>> list)
LocalFeatureList
of FloatLocalFeatureAdaptor
by
wrapping the input list, and dynamically wrapping with the
FloatLocalFeatureAdaptor
s on demand.list
- the input listpublic static List<FloatLocalFeatureAdaptor<?>> wrapUntyped(List<? extends LocalFeature<?,?>> list)
LocalFeatureList
of FloatLocalFeatureAdaptor
by
wrapping the input list, and dynamically wrapping with the
FloatLocalFeatureAdaptor
s on demand.list
- the input listpublic static <L extends Location> List<FloatLocalFeatureAdaptor<L>> wrap(List<? extends LocalFeature<L,?>> list, Normaliser<FloatFV> normaliser)
LocalFeatureList
of FloatLocalFeatureAdaptor
by
wrapping the input list, and dynamically wrapping with the
FloatLocalFeatureAdaptor
s on demand.list
- the input listnormaliser
- the normaliserpublic static List<FloatLocalFeatureAdaptor<?>> wrapUntyped(List<? extends LocalFeature<?,?>> list, Normaliser<FloatFV> normaliser)
LocalFeatureList
of FloatLocalFeatureAdaptor
by
wrapping the input list, and dynamically wrapping with the
FloatLocalFeatureAdaptor
s on demand.list
- the input listnormaliser
- the normaliser