康巴易测肤/伤疤uniapp小程序类
Vous ne pouvez pas sélectionner plus de 25 sujets Les noms de sujets doivent commencer par une lettre ou un nombre, peuvent contenir des tirets ('-') et peuvent comporter jusqu'à 35 caractères.

24 lignes
608B

  1. import Action from "./Action.js"
  2. class NodHead extends Action {
  3. constructor(second=10,fun,limit=1) {
  4. super(second,fun,limit,'请点头')
  5. this.maxPitch = 0
  6. this.minPitch = 0
  7. }
  8. takeFrame(faceData){
  9. let face = faceData.faceInfo[0]
  10. if(face.angleArray.pitch>this.maxPitch){
  11. this.maxPitch = face.angleArray.pitch
  12. }
  13. if(face.angleArray.pitch<this.minPitch){
  14. this.minPitch = face.angleArray.pitch
  15. }
  16. if(Math.abs(this.minPitch-this.maxPitch)>0.45 && (this.minPitch || this.maxPitch) ){
  17. this.frames.push('点头')
  18. this.maxPitch = 0
  19. this.minPitch = 0
  20. }
  21. }
  22. }
  23. export default NodHead