중간 발표에서 언급한 아이템
선행되어야 하는 기능 : 출석 or 게임 승리시 user에게 일정 point를 부여 해줌
고려했던 아이템 자리 6칸
자기 자신에게 아이템을 사용
타인에게 아이템 사용
⇒ 아이템 중복 사용 안되도록, 아이템 사용 중에 버튼 비활성화
⇒ 아예 show false로 꺼버리는 것도 괜찮을 듯
빈자리에다가
⇒ (자신에게 아이템 사용) 빈 칸에 “자신에게 아이템 A를 사용했습니다” ,
⇒ (타인에게 아이템 사용) “B 에게 아이템 C를 사용했습니다”
⇒ (거짓말 탐지 결과) “D는 거짓말을 하고 있습니다 !”
아이템 case / fileters app.js에서
filter type & option 골라서 filter에 저장
function applyFilter() {
var filter = { type: '', options: {} };
var type = $('input[name=filter]:checked').val();
switch (type) {
// 회색화면
case 'Grayscale':
filter.type = 'GStreamerFilter';
filter.options = { "command": "videobalance saturation=0.0" };
break;
// 뒤집기
case 'Rotation':
filter.type = 'GStreamerFilter';
filter.options = { "command": "videoflip method=vertical-flip" };
break;
// 음성변조
case 'Pitch':
filter.type = 'GStreamerFilter';
filter.options = { "command": "pitch pitch=20" };
break;
// 테두리
case 'Videobox':
filter.type = 'GStreamerFilter';
filter.options = { "command": "videobox fill=black top=-30 bottom=-30 left=-30 right=-30" };
break;
// 화면 색 왜곡
case 'Chroma':
filter.type = 'GStreamerFilter';
filter.options = { "command": 'chromahold target-r=0 target-g=0 target-b=255 tolerance=90' };
break;
}
}
selectedStreamManager.stream.applyFilter(filter.type, filter.options)
function removeFilter() {
selectedStreamManager.stream.removeFilter();
}
기본 OvVideo
<template>
<video autoplay/>
</template>
<script>
export default {
name: 'OvVideo',
props: {
streamManager: Object,
},
mounted () {
this.streamManager.addVideoElement(this.$el);
},
};
</script>
FaceAPI적용
<video ref="myWebCam"/>
const state = reactive({
detections: null,
myEmotion: '',
lie: false,
emotions: {
angry: 0,
disgusted: 0,
fearful: 0,
happy: 0,
neutral: 0,
sad: 0,
surprised: 0,
},
})
state.detections = await faceapi.detectSingleFace(myWebCam.value, new faceapi.TinyFaceDetectorOptions())
.withFaceExpressions()
onMounted(async () => {
props.streamManager.addVideoElement(myWebCam.value)
await faceapi.nets.tinyFaceDetector.load('..경로')
await faceapi.nets.faceExpressionNet.load('..경로')
})
기존 FaceAPI 적용 코드에서는 emotion의 합이 3이상이면 거짓말이라고 탐지하였음
itemshop
@click =“FaceEmotion()”
faceEmotionstate = true
⇒ vuex에서 상태관리하고 watch로 받아줌
⇒ store에 item 모듈 생성