T
- Type of featureQ
- Type of featurevectorpublic class FaceFVComparator<T extends FacialFeature & FeatureVectorProvider<Q>,Q extends FeatureVector> extends Object implements FacialFeatureComparator<T>
FacialFeatureComparator
for FacialFeature
s that can
provide FeatureVector
s through the FeatureVectorProvider
interface. Any compatible FVComparator
can be used to compare
features.Constructor and Description |
---|
FaceFVComparator(FVComparator<Q> comp)
Construct with the given
FVComparator |
Modifier and Type | Method and Description |
---|---|
byte[] |
binaryHeader()
Header for binary input.
|
double |
compare(T query,
T target)
Compare two objects, returning a score
or distance.
|
boolean |
isDistance() |
void |
readBinary(DataInput in)
Read internal state from in.
|
String |
toString() |
void |
writeBinary(DataOutput out)
Write the content of this as binary to out.
|
public FaceFVComparator(FVComparator<Q> comp)
FVComparator
comp
- the comparison techniquepublic double compare(T query, T target)
DistanceComparator
compare
in interface DistanceComparator<T extends FacialFeature & FeatureVectorProvider<Q>>
query
- the first objecttarget
- the second objectpublic boolean isDistance()
isDistance
in interface DistanceComparator<T extends FacialFeature & FeatureVectorProvider<Q>>
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 writeBinary(DataOutput out) throws IOException
WriteableBinary
writeBinary
in interface WriteableBinary
out
- sink to write toIOException
- an error writing to out