康巴易测肤/伤疤uniapp小程序类
Nevar pievienot vairāk kā 25 tēmas Tēmai ir jāsākas ar burtu vai ciparu, tā var saturēt domu zīmes ('-') un var būt līdz 35 simboliem gara.

24 rindas
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