@Reference(type=Inproceedings,
author={"Turk, M.A.","Pentland, A.P."},
title="Face recognition using eigenfaces",
year="1991",
booktitle="Computer Vision and Pattern Recognition, 1991. Proceedings CVPR \'91., IEEE Computer Society Conference on",
pages={"586 ","591"},
month="jun",
number="",
volume="",
customData={"keywords","eigenfaces;eigenvectors;face images;face recognition system;face space;feature space;human faces;two-dimensional recognition;unsupervised learning;computerised pattern recognition;eigenvalues and eigenfunctions;","doi","10.1109/CVPR.1991.139758"})
public class EigenImages
extends Object
implements BatchTrainer<org.openimaj.image.FImage>, FeatureExtractor<DoubleFV,org.openimaj.image.FImage>, org.openimaj.io.ReadWriteableBinary
Fundamentally, the EigenImages technique is a way to perform dimensionality
reduction on an image using PCA. This implementation can be trained through
the BatchTrainer interface (which will internally normalise the data
and perform PCA). Once trained, instances can be used as
FeatureExtractors to extract low(er) dimensional features from
images.
Methods are also provided to reconstruct an image from its feature vector
(see and #reconstruct(double[]), and to
visualise a specific principal component as an image (see
visualisePC(int).
| Modifier | Constructor and Description |
|---|---|
protected |
EigenImages()
For serialisation
|
|
EigenImages(int numComponents)
Construct with the given number of principal components.
|
| Modifier and Type | Method and Description |
|---|---|
byte[] |
binaryHeader() |
DoubleFV |
extractFeature(org.openimaj.image.FImage img) |
int |
getNumComponents()
Get the number of PCA components selected by this
EigenImages
object. |
void |
readBinary(DataInput in) |
org.openimaj.image.FImage |
reconstruct(double[] weights)
Reconstruct an image from a weight vector
|
org.openimaj.image.FImage |
reconstruct(DoubleFV weights)
Reconstruct an image from a weight vector
|
String |
toString() |
void |
train(List<? extends org.openimaj.image.FImage> data) |
org.openimaj.image.FImage |
visualisePC(int pc)
Draw a principal component as an image.
|
void |
writeBinary(DataOutput out) |
protected EigenImages()
public EigenImages(int numComponents)
numComponents - the number of PCspublic DoubleFV extractFeature(org.openimaj.image.FImage img)
extractFeature in interface FeatureExtractor<DoubleFV,org.openimaj.image.FImage>public void train(List<? extends org.openimaj.image.FImage> data)
train in interface BatchTrainer<org.openimaj.image.FImage>public org.openimaj.image.FImage reconstruct(DoubleFV weights)
weights - the weight vectorpublic org.openimaj.image.FImage reconstruct(double[] weights)
weights - the weight vectorpublic org.openimaj.image.FImage visualisePC(int pc)
pc - the index of the PC to draw.public void readBinary(DataInput in) throws IOException
readBinary in interface org.openimaj.io.ReadableBinaryIOExceptionpublic byte[] binaryHeader()
binaryHeader in interface org.openimaj.io.ReadableBinarybinaryHeader in interface org.openimaj.io.WriteableBinarypublic void writeBinary(DataOutput out) throws IOException
writeBinary in interface org.openimaj.io.WriteableBinaryIOExceptionpublic int getNumComponents()
EigenImages
object.