-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathindex.html
executable file
·50 lines (46 loc) · 1.75 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
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<meta name="format-detection" content="telephone=no" />
<meta name="viewport" content="user-scalable=no, initial-scale=1, maximum-scale=1, minimum-scale=1, width=device-width" />
<title>JS-Aruco Markers</title>
<style type="text/css">
canvas {
margin: 5px;
float: left;
display: block;
}
</style>
</head>
<body>
<div id="markers"></div>
<script type="text/javascript" src="cv.js"></script>
<script type="text/javascript" src="aruco.js"></script>
<script type="text/javascript" src="markers.js"></script>
<script type="text/javascript">
window.onload = function(){
var div = document.getElementById("markers");
var detector = new AR.Detector();
var width=160, height=160,pad=15;
var i=0;
var limit = Math.pow(4,5);
var hash = location.hash.replace("#",'');
if(hash.length >= 1) {
i=parseInt(hash);
limit=parseInt(hash)+1;
}
while(i<limit) {
var canvas = makeMarker(i,width,height);
var ctx = canvas.getContext('2d');
var markers = detector.detect(ctx.getImageData(0,0,canvas.width,canvas.height));
ctx.font = "bold 10px sans-serif";
ctx.fillStyle = 'red';
ctx.fillText("id: "+markers[0].id,10,10);
div.appendChild(canvas);
i++;
}
};
</script>
</body>
</html>