recognize: Recognize Image (Human Face)

Description Usage Arguments Examples

Description

Function for recognizing the image using the model trained from the data.

Usage

1
recognize(x, y, rule = "simple f-share", display = TRUE)

Arguments

x

string input; image file input to be recognize.

y

model supervised on learning from the training dataset.

rule

string input; stopping rule for choosing number of principal components. Options are: 'simple f-share' for simple fair-share; 'broken stick'; and, 'rel-broken stick' for relative broken stick stopping rule.

display

displays the input image, and the corresponding output image – as recognized by the model.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
To reproduce this example, please refer to \code{https://github.com/alstat/rface}

# Call the Face Recognition package
library(rface)
# Import all images in the directory "data/jaffe/"
imgData <- importImages("~/Downloads/jaffe_training/", display = FALSE)

# Show imported images
showFace(imgData)

# Take the average of the faces
img_mean <- aveFace(imgData, display = FALSE)

# Show the average of the faces
showFace(img_mean)

# Train the algorithm for the images
model <- learn(imgData)

# Show the eigen faces
showFace(model)

# Input an image and recognize it
recognize("~/Downloads/jaffe_testing/KA.AN1.39.tiff", model, display = TRUE, rule = "simple f-share")

alstat/rface documentation built on May 10, 2019, 10:25 a.m.