Description Usage Arguments Value Examples
View source: R/FeatureSpaceProjection.R
The projection of the vector onto the linear span of the eigenfaces is computed by projecting an 'image_ef' onto every single vector of the set of eigenfaces. A given average face is substracted before the projection and added onto the projection afterwards.
1 2 | ## S3 method for class 'image_ef'
FSP(obj, eigenfaces, avgFace, showCoefficients = FALSE, ...)
|
obj |
an object of class 'image_ef' |
eigenfaces |
an object of class 'imageset_ef', eigenfaces of an 'imageset_ef' object td |
avgFace |
an object of class 'image_ef', average face of td |
showCoefficients |
(optional) logical vector of length 1 (TRUE or FALSE) |
... |
additional arguments |
case showCoefficients=FALSE
: a list of length 1 containing an object of class 'image_ef',
projection of img
onto the linear span of eigenfaces
case showCoefficients=TRUE
: a list of length 2 additionally containing a numeric vector where the
coefficients for the representation with the eigenfaces are saved
1 2 3 4 5 6 7 | # Import Olivetti-faces
olivetti <- system.file("extdata","olivetti_X.csv",package="eigenfaces")
td <- load_imageset_ef(olivetti, c(64,64))
img <- td[[42]]
eigenfaces <- get_eigenfaces(td, nfaces = 50, quick=TRUE)
avgFace <- avg_face(td)
projection <- FSP(img, eigenfaces, avgFace, showCoefficients=FALSE)[[1]]
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.