人脸图片格式处理
This commit is contained in:
parent
480ab6d7b9
commit
71c241585a
|
|
@ -125,7 +125,7 @@ async function detectAction(action) {
|
||||||
const rightEye = landmarks.getRightEye()
|
const rightEye = landmarks.getRightEye()
|
||||||
const eyeDiff = Math.abs(leftEye[0].y - rightEye[3].y)
|
const eyeDiff = Math.abs(leftEye[0].y - rightEye[3].y)
|
||||||
if (eyeDiff < 10) {
|
if (eyeDiff < 10) {
|
||||||
capturedFiles.front = await captureImage(video.value, 'front.png')
|
capturedFiles.front = await captureImage(video.value, 'front.jpg')
|
||||||
clearInterval(interval)
|
clearInterval(interval)
|
||||||
resolve()
|
resolve()
|
||||||
}
|
}
|
||||||
|
|
@ -133,7 +133,7 @@ async function detectAction(action) {
|
||||||
|
|
||||||
if (action === 'mouth') {
|
if (action === 'mouth') {
|
||||||
if (isMouthOpen(landmarks)) {
|
if (isMouthOpen(landmarks)) {
|
||||||
capturedFiles.mouth = await captureImage(video.value, 'mouth.png')
|
capturedFiles.mouth = await captureImage(video.value, 'mouth.jpg')
|
||||||
clearInterval(interval)
|
clearInterval(interval)
|
||||||
resolve()
|
resolve()
|
||||||
}
|
}
|
||||||
|
|
@ -142,7 +142,7 @@ async function detectAction(action) {
|
||||||
if (action === 'yaw') {
|
if (action === 'yaw') {
|
||||||
const yaw = estimateYaw(landmarks)
|
const yaw = estimateYaw(landmarks)
|
||||||
if (Math.abs(yaw) > YAW_THRESHOLD) {
|
if (Math.abs(yaw) > YAW_THRESHOLD) {
|
||||||
capturedFiles.yaw = await captureImage(video.value, 'yaw.png')
|
capturedFiles.yaw = await captureImage(video.value, 'yaw.jpg')
|
||||||
clearInterval(interval)
|
clearInterval(interval)
|
||||||
resolve()
|
resolve()
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue