# wx.faceDetect(Object object)

Start from base library version 2.18.0. Please remaining backward compatible.

with Promise style call: Not supported

Mini Program plugin: Not supported

Face recognition, you need to pass wx.initFaceDetect Once initialized, frame data returned using the camera interface is recommended

# parameter

# Object object

attribute type Default values Required Introductions
frameBuffer ArrayBuffer yes Image pixel data, each of four items representing a pixel RGBA
width number yes Image width
height number yes Image height
enablePoint boolean false no Whether to return the face of the current image 106 (Point)
enableConf boolean false no Whether to return the confidence level of the face of the current image (indicating organ occlusion)
enableAngle boolean false no Whether to return face angle information of current image
enableMultiFace boolean false no Whether to return information about multiple faces
success function no Interface calls the successful callback function
fail function no Interface calls failed callback functions
complete function no Callback function at the end of an interface call (both successful and unsuccessful calls are executed)

# object.success callback

# parameter
# Object res
attribute type Introductions
detectRect Object Face positive box value, the object contains height, weight, originX, originY 初始值
x number If the face cannot be detected, then -1
and number If the face cannot be detected by the center point of the face; -1
pointArray Array.&ltObject&gt Face 106 An array of dot positions each object contains x and and
confArray Object Face confidence, range of values [0, 1], the greater the value, the higher the confidence (less occlusion)
angleArray Object Face angle information, value range [-1, 1]The closer the values are, 0 The more you look at the camera,
faceInfo Array.&ltObject&gt Face information in enable multi-face mode, each object contains the above other attributes

res.confArray Structure

attribute type Introductions
global number Overall credibility
leftEye number Left eye credibility
rightEye number Right eye credibility
mouth number Mouth credibility
nose number Nose credibility

res.angleArray Structure

attribute type Introductions
pitch number Pitch angle (nod)
yaw number Yaw angle (shake head)
roll number Tumbling angle (left and right tilt)