headtrackr JS头部跟踪库 项目简介
headtrackr 是一个用于实时脸部追踪和头部追踪的 JS 库。通过网络摄像头和 webRTC/getUserMedia 标准,在相关计算机屏幕上追踪用户头部的位置。请查看如下示例: 使用方法:<script src="js/headtrackr.js"></script>
<canvas id="inputCanvas" width="320" height="240" style="display:none"></canvas>
<video id="inputVideo" autoplay loop></video>
<script type="text/javascript">
var videoInput = document.getElementById('inputVideo');
var canvasInput = document.getElementById('inputCanvas');
var htracker = new headtrackr.Tracker();
htracker.init(videoInput, canvasInput);
htracker.start();
</script>
<canvas id="inputCanvas" width="320" height="240" style="display:none"></canvas>
<video id="inputVideo" autoplay loop></video>
<script type="text/javascript">
var videoInput = document.getElementById('inputVideo');
var canvasInput = document.getElementById('inputCanvas');
var htracker = new headtrackr.Tracker();
htracker.init(videoInput, canvasInput);
htracker.start();
</script>