Skip to content

face_LBPHFaceRecognizer

faceclassOpenCV 5.0.0
import { face_LBPHFaceRecognizer } from '@banou/opencv-wasm'

Use after await initOpenCV(). See the initialization and named imports guide.

ARGUMENTSConstructor or factory
CLASSface_LBPHFaceRecognizer
RETURN TYPEOwned native handle
Call structure. A void return can still write to destination arguments. The parameter descriptions define inputs, outputs and ownership.

Native object: release it with using or delete(). Factories can return null; check before calling methods. Inherits face_FaceRecognizer.

face lbphface recognizer value in the OpenCV API.

Constructors and members

static create

Create an owned face_LBPHFaceRecognizer instance with the supplied configuration.

create(radius: number, neighbors: number, grid_x: number, grid_y: number, threshold: number): face_LBPHFaceRecognizer | null;
6 available overloads
create(): face_LBPHFaceRecognizer | null;
create(radius: number): face_LBPHFaceRecognizer | null;
create(radius: number, neighbors: number): face_LBPHFaceRecognizer | null;
create(radius: number, neighbors: number, grid_x: number): face_LBPHFaceRecognizer | null;
create(radius: number, neighbors: number, grid_x: number, grid_y: number): face_LBPHFaceRecognizer | null;
create(radius: number, neighbors: number, grid_x: number, grid_y: number, threshold: number): face_LBPHFaceRecognizer | null;
radius

The radius used for building the Circular Local Binary Pattern. The greater the radius, the smoother the image but more spatial information you can get.

neighbors

The number of sample points to build a Circular Local Binary Pattern from. An appropriate value is to use 8 sample points. Keep in mind: the more sample points you include, the higher the computational cost.

grid_x

The number of cells in the horizontal direction, 8 is a common value used in publications. The more cells, the finer the grid, the higher the dimensionality of the resulting feature vector.

grid_y

The number of cells in the vertical direction, 8 is a common value used in publications. The more cells, the finer the grid, the higher the dimensionality of the resulting feature vector.

threshold

The threshold applied in the prediction. If the distance to the nearest neighbor is larger than the threshold, this method returns -1.

Notes:

  • The Circular Local Binary Patterns (used in training and prediction) expect the data given as grayscale images, use cvtColor to convert between the color spaces.
  • This model supports updating.

Model internal data:

  • radius see LBPHFaceRecognizer::create.
  • neighbors see LBPHFaceRecognizer::create.
  • grid_x see LLBPHFaceRecognizer::create.
  • grid_y see LBPHFaceRecognizer::create.
  • threshold see LBPHFaceRecognizer::create.
  • histograms Local Binary Patterns Histograms calculated from the given training data (empty if none was given).
  • labels Labels corresponding to the calculated Local Binary Patterns Histograms.
Returns

The face_LBPHFaceRecognizer | null result.

clone

Create another handle to the same native object. This retains the object without copying its pixels or algorithm state; dispose both handles separately.

clone(): this;
Returns

The this result.

getGridX

face_LBPHFaceRecognizer.getGridX: See: setGridX

getGridX(): number;
Returns

The number result.

setGridX

See: setGridX See: getGridX

setGridX(val: number): void;
val

val argument (number).

getGridY

face_LBPHFaceRecognizer.getGridY: See: setGridY

getGridY(): number;
Returns

The number result.

setGridY

See: setGridY See: getGridY

setGridY(val: number): void;
val

val argument (number).

getRadius

face_LBPHFaceRecognizer.getRadius: See: setRadius

getRadius(): number;
Returns

The number result.

setRadius

See: setRadius See: getRadius

setRadius(val: number): void;
val

val argument (number).

getNeighbors

See: setNeighbors

getNeighbors(): number;
Returns

The number result.

setNeighbors

See: setNeighbors See: getNeighbors

setNeighbors(val: number): void;
val

val argument (number).

getThreshold

See: setThreshold

getThreshold(): number;
Returns

The number result.

setThreshold

See: setThreshold See: getThreshold

setThreshold(val: number): void;
val

val argument (number).

getHistograms

Return the histograms configured on this face_LBPHFaceRecognizer object.

getHistograms(): MatVector;
Returns

The MatVector result. Release returned native handles with using or delete(), including handles nested in results.

getLabels

Return the labels configured on this face_LBPHFaceRecognizer object.

getLabels(): Mat;
Returns

The Mat result. Release returned native handles with using or delete(), including handles nested in results.

These signatures describe this package. Upstream documentation can mention optional backends that are absent from this build. Check runtime compatibility before choosing a backend or file format.