Skip to content

face_getFacesHAAR

facefunctionOpenCV 5.0.0
import { face_getFacesHAAR } from '@banou/opencv-wasm'

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

ARGUMENTSimage, faces, face_cascade_name
FUNCTIONface_getFacesHAAR
RETURN TYPEboolean
Call structure. A void return can still write to destination arguments. The parameter descriptions define inputs, outputs and ownership.

Default face detector This function is mainly utilized by the implementation of a Facemark Algorithm. End users are advised to use function Facemark::getFaces which can be manually defined and circumvented to the algorithm by Facemark::setFaceDetector.

std::vector<cv::Rect> faces;
CParams params("haarcascade_frontalface_alt.xml");
cv::face::getFaces(frame, faces, &params);
for(int j=0;j<faces.size();j++){
    cv::rectangle(frame, faces[j], cv::Scalar(255,0,255));
}
cv::imshow("detection", frame);
face_getFacesHAAR(image: Mat, faces: Mat, face_cascade_name: EmbindString): boolean;
image

The input image to be processed.

faces

Output destination, filled by the native operation. Output of the function which represent region of interest of the detected faces. Each face is stored in cv::Rect container.

face_cascade_name

face cascade name argument (EmbindString).

Returns

The boolean result.

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.