public class ObjectFeatureQuantized extends ObjectFeature implements BinarySerializable, StringDataProvider
LocalAbstractObject.DataEqualObject, LocalAbstractObject.TextStreamFactory<T extends LocalAbstractObject>, LocalAbstractObject.TrivialDistanceFunction
Modifier and Type | Field and Description |
---|---|
protected long[] |
keys
List of quantized keys of this feature (e.g.
|
static java.lang.String |
QUANTIZED_FEATURE_KEY_SPLIT_CHARACTER
Character separating code of individual quantizers if more independent quantizer are used to create one visual word
|
ori, scl, x, y
counterDistanceComputations, counterLowerBoundDistanceComputations, counterPrecomputedDistanceSavings, counterUpperBoundDistanceComputations, MAX_DISTANCE, MIN_DISTANCE, suppData, trivialDistanceFunction, UNKNOWN_DISTANCE
Modifier | Constructor and Description |
---|---|
|
ObjectFeatureQuantized()
Default constructor that sets the params to 0f and null.
|
protected |
ObjectFeatureQuantized(BinaryInput input,
BinarySerializator serializator)
Creates a new instance of ObjectFeature loaded from binary input buffer.
|
|
ObjectFeatureQuantized(java.io.BufferedReader stream)
Expected format:
#key locator
x, y, orientation, scale; key1, key2, key3...
|
|
ObjectFeatureQuantized(float x,
float y,
float ori,
float scl) |
|
ObjectFeatureQuantized(float x,
float y,
float ori,
float scl,
long[] keys) |
Modifier and Type | Method and Description |
---|---|
void |
addKey(long key) |
int |
binarySerialize(BinaryOutput output,
BinarySerializator serializator)
Binary-serialize this object into the
output . |
boolean |
dataEquals(java.lang.Object obj)
Indicates whether some other object has the same data as this one.
|
int |
dataHashCode()
Returns a hash code value for the data of this object.
|
boolean |
dataQuantizedEquals(java.lang.Object obj)
Indicates whether some other object has the same quantized data as this one.
|
int |
getBinarySize(BinarySerializator serializator)
Returns the exact size of the binary-serialized version of this object in bytes.
|
protected float |
getDistanceImpl(LocalAbstractObject obj,
float distThreshold)
Trivial Metric function implemented as equality on all the keys.
|
long[] |
getKeys() |
int |
getSize()
Returns the size of object in bytes
|
java.lang.String |
getStringData()
Returns the textual data provided by this object.
|
void |
setKeys(long[] keys) |
java.lang.String |
toString()
Returns a string representation of this abstract object.
|
void |
writeData(java.io.OutputStream stream)
Store this object's data to a text stream.
|
cloneRandomlyModify, getOrientation, getScale, getX, getY, setOri, setScl, setX, setY
clearSurplusData, clone, clone, create, create, createMetaDistancesHolder, excludeUsingPrecompDist, getDistance, getDistance, getDistance, getDistanceFilter, getDistanceFilter, getDistanceFilter, getDistanceFilter, getDistanceLowerBound, getDistanceLowerBoundImpl, getDistanceStorePrecomputed, getDistanceStorePrecomputed, getDistanceStorePrecomputed, getDistanceUpperBound, getDistanceUpperBoundImpl, getFieldsForNames, getMaxDistance, getNormDistance, getPrecomputedDistance, getPrecomputedDistance, getRandomChar, getRandomNormal, chainDestroy, chainFilter, includeUsingPrecompDist, isDistanceCompatible, parseObjectComment, peekNextChar, readAttributesFromStream, readObjectComments, readObjectCommentsWithoutData, unchainFilter, write, write, writeAttributesToStream, writeObjectComment
clone, getLocatorURI, getNoDataObject, getObjectKey, getObjectKey, getObjectLocatorURI, setObjectKey
protected long[] keys
public static final java.lang.String QUANTIZED_FEATURE_KEY_SPLIT_CHARACTER
public ObjectFeatureQuantized()
public ObjectFeatureQuantized(float x, float y, float ori, float scl)
public ObjectFeatureQuantized(float x, float y, float ori, float scl, long[] keys)
public ObjectFeatureQuantized(java.io.BufferedReader stream) throws java.io.IOException, java.lang.NumberFormatException
stream
- java.io.IOException
java.lang.NumberFormatException
protected ObjectFeatureQuantized(BinaryInput input, BinarySerializator serializator) throws java.io.IOException
input
- the buffer to read the ObjectFeature fromserializator
- the serializator used to write objectsjava.io.IOException
- if there was an I/O error reading from the bufferpublic void writeData(java.io.OutputStream stream) throws java.io.IOException
LocalAbstractObject
writeData
in class ObjectFeature
stream
- the stream to store this object tojava.io.IOException
- if there was an error while writing to streampublic boolean dataEquals(java.lang.Object obj)
LocalAbstractObject
dataEquals
in class ObjectFeature
obj
- the reference object with which to compare.true
if this object is the same as the obj
argument; false
otherwise.public boolean dataQuantizedEquals(java.lang.Object obj)
obj
- the reference object with which to compare.true
if this object is the same as the obj
argument (in their quantization); false
otherwise.public int dataHashCode()
LocalAbstractObject
dataHashCode
in class ObjectFeature
protected float getDistanceImpl(LocalAbstractObject obj, float distThreshold)
getDistanceImpl
in class LocalAbstractObject
obj
- the object to compute distance todistThreshold
- the threshold value on the distancepublic int getSize()
getSize
in class ObjectFeature
public long[] getKeys()
public void setKeys(long[] keys)
public void addKey(long key)
public java.lang.String getStringData()
StringDataProvider
getStringData
in interface StringDataProvider
public int binarySerialize(BinaryOutput output, BinarySerializator serializator) throws java.io.IOException
LocalAbstractObject
output
.binarySerialize
in interface BinarySerializable
binarySerialize
in class ObjectFeature
output
- the output that this object is binary-serialized intoserializator
- the serializator used to write objectsjava.io.IOException
- if there was an I/O error during serializationpublic int getBinarySize(BinarySerializator serializator)
LocalAbstractObject
getBinarySize
in interface BinarySerializable
getBinarySize
in class ObjectFeature
serializator
- the serializator used to write objectspublic java.lang.String toString()
AbstractObject
toString
in class AbstractObject