Permalink
Switch branches/tags
Nothing to show
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
47 lines (37 sloc) 1.08 KB
<html>
<head>
<script src="clmtrackr.js"></script>
<script src="models/model_pca_20_svm.js"></script>
<script src="p5.js"></script>
<script src="p5.dom.js"></script>
<script>
var ctracker;
function setup() {
// setup camera capture
var videoInput = createCapture(VIDEO);
videoInput.size(400, 300);
videoInput.position(0, 0);
// setup canvas
var cnv = createCanvas(400, 300);
cnv.position(0, 0);
// setup tracker
ctracker = new clm.tracker();
ctracker.init(pModel);
ctracker.start(videoInput.elt);
noStroke();
}
function draw() {
clear();
// get array of face marker positions [x, y] format
var positions = ctracker.getCurrentPosition();
var mouthTop = positions[60][1];
var mouthBottom = positions[57][1];
var mouthSize = mouthBottom - mouthTop;
console.log(mouthSize);
}
</script>
<style> body { padding: 0; margin: 0} </style>
</head>
<body>
</body>
</html>