| | |
| | | import Speech from 'speak-tts' |
| | | import { reactive,computed, toRefs, onMounted, watch, ref } from "vue" |
| | | import { sendPationCodeApi } from '../../samples/httpApi' |
| | | import { formatDate } from '@/utils/formatTime' |
| | | import { formatDate,jgTime } from '@/utils/formatTime' |
| | | import { confingInfoStore } from '@/stores/StoresConfing' |
| | | import {base64toFile} from '@/samples/faceApi' |
| | | import{initPort} from '@/samples/portApi' |
| | |
| | | import{toDataTz,todatatzs } from '@/samples/deviceApi/seca101' |
| | | import { ElLoading, ElMessage } from 'element-plus' |
| | | import { el } from 'element-plus/es/locale' |
| | | import { Console } from 'console' |
| | | let trackerTask: any = null; |
| | | let lsDateTime:any=new Date() |
| | | // 标识用的画布 |
| | | const myCanvas = ref<HTMLCanvasElement | null>(null); |
| | | let imgSrc:''; |
| | | const msg = ref<string>("没识别到人脸..."); |
| | | // 实例人脸检查器 |
| | | // 实例人脸检查器 ObjectTracker |
| | | const myTracker: any = new tracking.ObjectTracker("face"); |
| | | myTracker.setInitialScale(4); |
| | | myTracker.setStepSize(2); |
| | |
| | | context.clearRect(0, 0, myCanvas.value.width, myCanvas.value.height); |
| | | } |
| | | if (event.data.length === 0) { |
| | | // console.log('没有监测到---') |
| | | msg.value = "没识别到人脸..."; |
| | | } else if(event.data.length === 1) { |
| | | } else if(event.data.length >= 1){ |
| | | trackerTask.stop(); |
| | | msg.value = "检测到人脸"; |
| | | console.log('监测到人脸2样') |
| | | console.log(event.data) |
| | | const myCanvas = document.getElementById("myCanvas");// |
| | | const thisContext = myCanvas?.getContext("2d"); |
| | | const myVideo = document.querySelector("#myVideo") as HTMLVideoElement; |
| | | thisContext.drawImage(myVideo, 0,0, 250, 200); |
| | | imgSrc = myCanvas?.toDataURL('image/png'); |
| | | const X= jgTime(lsDateTime,new Date()) |
| | | |
| | | // 转文件 |
| | | // 识别框显示才能到传阿里云识别 |
| | | if(dialogVisible.value){ |
| | | if(dialogVisible.value&&X>configData.value.face_push){ |
| | | lsDateTime=new Date() |
| | | console.log(X,'上传阿里识别间隔') |
| | | base64toFile(imgSrc) |
| | | } |
| | | setTimeout(() => { |
| | |
| | | console.log(0%5) |
| | | console.log('页面初始化', os.hostname()) |
| | | setTimeout(()=>{ |
| | | |
| | | console.log('8秒后执行') |
| | | console.log('打印设置文件') |
| | | console.log(configData.value) |