-
Notifications
You must be signed in to change notification settings - Fork 9
/
index.html
72 lines (70 loc) · 3.86 KB
/
index.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>ccv.js</title>
<script type="text/javascript" src="https://webrtc.github.io/adapter/adapter-latest.js"></script>
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/stats.js/r16/Stats.min.js"></script>
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/dat-gui/0.5.1/dat.gui.min.js"></script>
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/jquery/1.12.4/jquery.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js" integrity="sha384-Tc5IQib027qvyjSMfHjOMaLkfuWVxZxUPnCJA7l2mCWNIpG9mGCD8wGNIcPD7Txa" crossorigin="anonymous"></script>
<link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-BVYiiSIFeK1dGmJRAkycuHAHRg32OmUcww7on3RYdg4Va+PmSTsz/K68vbdEjh4u" crossorigin="anonymous">
<script type="text/javascript" src="examples/loaders.js"></script>
<script type="text/javascript" src="examples/index.js"></script>
<script>
// Options to give to the emscripten Module (exported as "CCVLib"): https://kripken.github.io/emscripten-site/docs/api_reference/module.html
const CCVLibOptions = {
postRun: [
() => {
console.log('CCVLib initialized', window.CCV);
setTimeout(() => window.initPage(), 0);
}
]
};
// Load the wasm binary first. TODO: check for wasm support first
fetch('build/ccv_wasm.wasm')
.then((res) => {
if (!res.ok) {
throw new Error(res.statusText);
}
return res;
})
.then((res) => res.arrayBuffer())
.then((buffer) => {
// Success
console.log('WASM binary loaded, loading ccv_wasm.js');
return loadScript('build/ccv_wasm.js').then(() => {
CCVLibOptions.wasmBinary = buffer;
window.CCV = CCVLib(CCVLibOptions);
});
})
.catch((err) => {
// Fallback
console.log('Could not load WASM binary, falling back to ccv.js');
return loadScript('build/ccv.js').then(() =>{
window.CCV = CCVLib(CCVLibOptions);
});
});
</script>
</head>
<body style="padding:50px 0">
<a href="https://github.com/fta2012/ccv-js"><img style="position: absolute; top: 0; right: 0; border: 0;" src="https://camo.githubusercontent.com/38ef81f8aca64bb9a64448d0d70f1308ef5341ab/68747470733a2f2f73332e616d617a6f6e6177732e636f6d2f6769746875622f726962626f6e732f666f726b6d655f72696768745f6461726b626c75655f3132313632312e706e67" alt="Fork me on GitHub" data-canonical-src="https://s3.amazonaws.com/github/ribbons/forkme_right_darkblue_121621.png"></a>
<div class="container">
<h1 class="page-header">CCV.js</h1>
<p>
This page contains a bunch of demos for <a href="http://libccv.org/">ccv</a> (a minimalistic computer vision library written in C) compiled to javascript using emscripten.
</p>
<ul>
<li>Requires a webcam on desktop chrome or firefox with a decent CPU.</li>
<li>If you want to try your own images you can change source to an <a href="http://imgur.com">imgur</a> link.</li>
<li>Some of the demos work with video input. You can either use WEBCAM as source or an animated imgur gifs (but they need to be pretty small such as http://imgur.com/gallery/MWg8sz0).</li>
<li>Be sure to stop each demo before moving on to the next. These demos aren't using webworkers so the slower ones will freeze your browser.</li>
<li>Most examples should run in under 5 secs (except for DPM).</li>
</ul>
<div id="content">
Loading demos...
</div>
</div>
</body>
</html>