Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Jan 22, 2026

The face module (part of opencv_contrib) is not included in the default opencv.js build. Users requesting cv.face.createFacemarkLBF need either a custom build or alternative approaches.

Changes

  • TypeScript definitions (src/types/opencv/face.ts): Complete type definitions for Facemark, FacemarkLBF, FacemarkLBF_Params, and face namespace
  • Documentation (doc/FACE_MODULE.md): Build instructions for opencv.js + opencv_contrib, alternative approaches (FaceDetectorYN, CascadeClassifier), usage examples with memory management
  • Example (doc/face-example.ts): Type-safe implementation demonstrating landmark detection workflow
  • README: Added opencv_contrib module availability section

Usage

The type definitions enable IntelliSense for both custom and default builds:

// Works with custom opencv.js build (opencv + opencv_contrib)
const facemark = cv.face.createFacemarkLBF();
facemark.loadModel('lbfmodel.yaml');

const faces = new cv.RectVector();
faceCascade.detectMultiScale(gray, faces);

const landmarks = new cv.MatVector();
const success: boolean = facemark.fit(gray, faces, landmarks);
// landmarks contains 68 Point2f per face for LBF model

Users wanting facial features have two paths: build custom opencv.js per doc/FACE_MODULE.md, or use FaceDetectorYN/CascadeClassifier from the default build.

Original prompt

This section details on the original issue you should resolve

<issue_title>Add support for createFacemarkLBF</issue_title>
<issue_description>Is there any guide on implementing cv.face.createFacemarkLBF?</issue_description>

Comments on the Issue (you are @copilot in this section)


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

Copilot AI and others added 2 commits January 22, 2026 05:10
…umentation

Co-authored-by: ttt43ttt <132509+ttt43ttt@users.noreply.github.com>
Co-authored-by: ttt43ttt <132509+ttt43ttt@users.noreply.github.com>
Copilot AI changed the title [WIP] Add support for createFacemarkLBF implementation Add TypeScript definitions and documentation for cv.face.createFacemarkLBF Jan 22, 2026
Copilot AI requested a review from ttt43ttt January 22, 2026 05:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add support for createFacemarkLBF

2 participants