Skip to content

Commit

Permalink
delete trailing whitespace
Browse files Browse the repository at this point in the history
  • Loading branch information
yofreke committed Sep 12, 2016
1 parent c06b4f0 commit fcb8d39
Show file tree
Hide file tree
Showing 27 changed files with 5,516 additions and 5,516 deletions.
34 changes: 17 additions & 17 deletions examples/clm_image.html
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
margin: 0px auto;
max-width: 1150px;
}

#overlay {
position: absolute;
top: 0px;
Expand All @@ -32,11 +32,11 @@
margin-right : 100px;
max-width: 950px;
}

#sketch {
display: none;
}

#filter {
display: none;
}
Expand Down Expand Up @@ -79,7 +79,7 @@
<script src="./ext_js/jquery.imgareaselect.pack.js"></script>
<script src="../node_modules/blob.js/Blob.js"></script>
<script src="../node_modules/filesaver.js/FileSaver.min.js"></script>

<link rel="stylesheet" type="text/css" href="./styles/imgareaselect-default.css" />

<div id="content">
Expand All @@ -104,23 +104,23 @@ <h2>Face tracking in images</h2>
var cc = document.getElementById('image').getContext('2d');
var overlay = document.getElementById('overlay');
var overlayCC = overlay.getContext('2d');

var img = new Image();
img.onload = function() {
cc.drawImage(img,0,0,625, 500);
};
img.src = './media/franck_02159.jpg';

var ctrack = new clm.tracker({stopOnConvergence : true});
ctrack.init(pModel);

stats = new Stats();
stats.domElement.style.position = 'absolute';
stats.domElement.style.top = '0px';
document.getElementById('container').appendChild( stats.domElement );

var drawRequest;

function animateClean() {
ctrack.start(document.getElementById('image'));
drawLoop();
Expand All @@ -130,35 +130,35 @@ <h2>Face tracking in images</h2>
ctrack.start(document.getElementById('image'), box);
drawLoop();
}

function drawLoop() {
drawRequest = requestAnimFrame(drawLoop);
overlayCC.clearRect(0, 0, 720, 576);
if (ctrack.getCurrentPosition()) {
ctrack.draw(overlay);
}
}

// detect if tracker fails to find a face
document.addEventListener("clmtrackrNotFound", function(event) {
ctrack.stop();
alert("The tracking had problems with finding a face in this image. Try selecting the face in the image manually.")
}, false);

// detect if tracker loses tracking of face
document.addEventListener("clmtrackrLost", function(event) {
ctrack.stop();
alert("The tracking had problems converging on a face in this image. Try selecting the face in the image manually.")
}, false);

// detect if tracker has converged
document.addEventListener("clmtrackrConverged", function(event) {
document.getElementById('convergence').innerHTML = "CONVERGED";
document.getElementById('convergence').style.backgroundColor = "#00FF00";
// stop drawloop
cancelRequestAnimFrame(drawRequest);
}, false);

// update stats on iteration
document.addEventListener("clmtrackrIteration", function(event) {
stats.update();
Expand All @@ -175,7 +175,7 @@ <h2>Face tracking in images</h2>
onSelectEnd : function(img, selection) {
// create box
var box = [selection.x1, selection.y1, selection.width, selection.height];

// do fitting
animate(box);
$('#overlay').removeClass('hide');
Expand All @@ -191,7 +191,7 @@ <h2>Face tracking in images</h2>
reader.onload = (function(theFile) {
return function(e) {
// check if positions already exist in storage

// Render thumbnail.
var canvas = document.getElementById('image')
var cc = canvas.getContext('2d');
Expand Down Expand Up @@ -240,7 +240,7 @@ <h2>Face tracking in images</h2>
if (files.length > 0) {
fileIndex = 0;
}

loadImage();
}
document.getElementById('files').addEventListener('change', handleFileSelect, false);
Expand Down
36 changes: 18 additions & 18 deletions examples/clm_video.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,14 @@
<link href="./styles/bootstrap.min.css" rel="stylesheet" type="text/css">
<style>
@import url(https://fonts.googleapis.com/css?family=Lato:300italic,700italic,300,700);

body {
font-family: 'Lato';
background-color: #f0f0f0;
margin: 0px auto;
max-width: 1150px;
}

#overlay {
position: absolute;
top: 0px;
Expand All @@ -32,36 +32,36 @@
-ms-filter : fliph; /*IE*/
filter : fliph; /*IE*/
}

#container {
position : relative;
width : 370px;
/*margin : 0px auto;*/
}

#content {
margin-top : 70px;
margin-left : 100px;
margin-right : 100px;
max-width: 950px;
}

#sketch {
display: block;
}

#filter {
display: none;
}

h2 {
font-weight : 400;
}

.nogum {
display : none;
}

.btn {
font-family: 'Lato';
font-size: 16px;
Expand Down Expand Up @@ -133,21 +133,21 @@ <h2>Facetracking example</h2>
var vid = document.getElementById('videoel');
var overlay = document.getElementById('overlay');
var overlayCC = overlay.getContext('2d');

var ctrack = new clm.tracker({useWebGL : true});
ctrack.init(pModel);

stats = new Stats();
stats.domElement.style.position = 'absolute';
stats.domElement.style.top = '0px';
document.getElementById('container').appendChild( stats.domElement );

function enablestart() {
var startbutton = document.getElementById('startbutton');
startbutton.value = "start";
startbutton.disabled = null;
}

var insertAltVideo = function(video) {
if (supports_video()) {
if (supports_ogg_theora_video()) {
Expand All @@ -167,15 +167,15 @@ <h2>Facetracking example</h2>
// check for camerasupport
if (navigator.getUserMedia) {
// set up stream

var videoSelector = {video : true};
if (window.navigator.appVersion.match(/Chrome\/(.*?) /)) {
var chromeVersion = parseInt(window.navigator.appVersion.match(/Chrome\/(\d+)\./)[1], 10);
if (chromeVersion < 20) {
videoSelector = "video";
}
};

navigator.getUserMedia(videoSelector, function( stream ) {
if (vid.mozCaptureStream) {
vid.mozSrcObject = stream;
Expand All @@ -197,7 +197,7 @@ <h2>Facetracking example</h2>
}

vid.addEventListener('canplay', enablestart, false);

function startVideo() {
// start video
vid.play();
Expand All @@ -206,7 +206,7 @@ <h2>Facetracking example</h2>
// start loop to draw face
drawLoop();
}

function drawLoop() {
requestAnimFrame(drawLoop);
overlayCC.clearRect(0, 0, 400, 300);
Expand All @@ -215,12 +215,12 @@ <h2>Facetracking example</h2>
ctrack.draw(overlay);
}
}

// update stats on every iteration
document.addEventListener('clmtrackrIteration', function(event) {
stats.update();
}, false);

</script>
</div>
</body>
Expand Down
2 changes: 1 addition & 1 deletion examples/example-browserify/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ var cc = canvas.getContext('2d');

function setup() {
video.play();

document.body.appendChild(canvas);

tracker.init(model);
Expand Down
8 changes: 4 additions & 4 deletions examples/example.html
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
#container {
position : relative;
}

#canvas {
position : absolute;
left : 0;
Expand All @@ -31,11 +31,11 @@ <h2>Example</h2>
<p id="positions"></p>
<script>
var videoInput = document.getElementById('video');

var ctracker = new clm.tracker();
ctracker.init(pModel);
ctracker.start(videoInput);

function positionLoop() {
requestAnimationFrame(positionLoop);
var positions = ctracker.getCurrentPosition();
Expand All @@ -50,7 +50,7 @@ <h2>Example</h2>
}
}
positionLoop();

var canvasInput = document.getElementById('canvas');
var cc = canvasInput.getContext('2d');
function drawLoop() {
Expand Down
Loading

0 comments on commit fcb8d39

Please sign in to comment.