@Reference(type=Article, author={"Belhumeur, Peter N.","Hespanha, Jo\\~{a}o P.","Kriegman, David J."}, title="Eigenfaces vs. Fisherfaces: Recognition Using Class Specific Linear Projection", year="1997", journal="IEEE Trans. Pattern Anal. Mach. Intell.", pages={"711","","720"}, url="http://dx.doi.org/10.1109/34.598228", month="July", number="7", publisher="IEEE Computer Society", volume="19", customData={"issn","0162-8828","numpages","10","doi","10.1109/34.598228","acmid","261512","address","Washington, DC, USA","keywords","Appearance-based vision, face recognition, illumination invariance, Fisher\'s linear discriminant."}) public class FisherImages extends Object implements BatchTrainer<IndependentPair<?,FImage>>, FeatureExtractor<DoubleFV,FImage>, ReadWriteableBinary
Constructor and Description |
---|
FisherImages(int numComponents)
Construct with the given number of components.
|
Modifier and Type | Method and Description |
---|---|
byte[] |
binaryHeader()
Header for binary input.
|
DoubleFV |
extractFeature(FImage object)
Extract features from an object and return them.
|
double[] |
getBasisVector(int index)
Get a specific basis vector as a double array.
|
void |
readBinary(DataInput in)
Read internal state from in.
|
<KEY> void |
train(GroupedDataset<KEY,? extends ListDataset<FImage>,FImage> data)
Train on a grouped dataset.
|
void |
train(List<? extends IndependentPair<?,FImage>> data)
Train the object with the given data.
|
void |
train(Map<?,? extends List<FImage>> data)
Train on a map of data.
|
FImage |
visualise(int num)
Draw an eigenvector as an image
|
void |
writeBinary(DataOutput out)
Write the content of this as binary to out.
|
public FisherImages(int numComponents)
numComponents
- the number of componentspublic 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 outpublic void train(Map<?,? extends List<FImage>> data)
data
- the datapublic <KEY> void train(GroupedDataset<KEY,? extends ListDataset<FImage>,FImage> data)
KEY
- The group typedata
- the datapublic void train(List<? extends IndependentPair<?,FImage>> data)
BatchTrainer
BatchTrainer
s should reset the underlying
model everytime this method is called.train
in interface BatchTrainer<IndependentPair<?,FImage>>
data
- the training datapublic DoubleFV extractFeature(FImage object)
FeatureExtractor
extractFeature
in interface FeatureExtractor<DoubleFV,FImage>
object
- the object to extract frompublic double[] getBasisVector(int index)
index
- the index of the vector