|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectbijnum.BIJpca
public class BIJpca
Principal component analysis (PCA) on 2-D sequences (ie. image sequences). Image sequences are organized as matrix with each image as a column vector. This is how you do it (Snapshot method by Sirovich et al.):
' is transpose cov = a * a' eiv = eigen(cov) sort eiv system by eigenvalues, largest first. diag = diagonal matrix of eigenvalues psi = a' * eigenvectors * diag eigenimages = psi'(c) 2003 Michael Abramoff. All rights reserved.
| Field Summary | |
|---|---|
float[][] |
a
The matrix of images. |
float[][] |
eigenimages
The matrix of eigenimages, i.e. |
float[] |
eigenvalues
The eigenvalues of the transpose of the covariance matrix. |
float[][] |
eigenvectors
The eigenvectors of the transpose of the covariance matrix. |
double |
totalVariance
Total accumulative variance. |
| Constructor Summary | |
|---|---|
BIJpca()
Set up PCA. |
|
BIJpca(float[][] eigenimages,
float[][] eigenvectors)
Set up PCA for already computed coordinates and eigenimages. |
|
| Method Summary | |
|---|---|
float[][] |
compute(float[][] a)
Compute the PCA. |
float[][] |
computeLinearCombination()
Compute the linear combination of all eigenimages. |
float[][] |
computeLinearCombination(float[] factor)
Compute a (compacted) linear combination of the imagevectors, using only with factor set to 1. |
float[] |
computeProjection(float[] v)
Compute the projection of a vector v onto the set of eigenimages. |
float[][] |
getCoordinates()
Get the eigenvector coordinate matrix an as a matrix. |
float[] |
getCoordinatesImage()
Get the eigenvector coordinate matrix an as an image (a float []) of width x height = eigenvectors.length. |
float[] |
getEigenImage(int j)
Compute the normalized image for eigenimage j so that it can be displayed with the same gray-scale as all others. |
double |
getTotalVariance()
|
float[] |
varianceSpectrum()
Compute the accumulated variance spectrum. |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public float[][] eigenimages
public float[] eigenvalues
public float[][] eigenvectors
public float[][] a
public double totalVariance
| Constructor Detail |
|---|
public BIJpca()
public BIJpca(float[][] eigenimages,
float[][] eigenvectors)
| Method Detail |
|---|
public float[][] compute(float[][] a)
throws java.lang.Exception
a - a matrix of float[][]. column size should be > row size.
java.lang.Exception
public float[] computeProjection(float[] v)
throws java.lang.Exception
v - a float[] vector (an image).
java.lang.Exceptionpublic float[][] computeLinearCombination()
public float[] getEigenImage(int j)
public float[][] getCoordinates()
public float[] getCoordinatesImage()
public float[][] computeLinearCombination(float[] factor)
an - the eigenvector coordinates (an) for the desired linear combination.
public float[] varianceSpectrum()
public double getTotalVariance()
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||