Created
April 25, 2014 02:01
-
-
Save fluidglassml/11275624 to your computer and use it in GitHub Desktop.
[wearscript] read tags
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<html style="width:100%; height:100%; overflow:hidden"> | |
<body style="width:100%; height:100%; overflow:hidden; margin:0" bgcolor="#000"> | |
<script> | |
function main() { | |
WS.say("Hello A R"); | |
if (WS.scriptVersion(1)) return; | |
WS.cameraOnBackgroundUnsafe(1, 360, 640); | |
var model_ar = btoa(msgpack.pack([{'kw': {}, 'name': 'picarus.ARMarkerDetector'}]).map(function (x) {return String.fromCharCode(x)}).join('')); | |
model = new WS.PicarusModel(model_ar, function () { | |
model.processStream(function (tags) { | |
tags = msgpack.unpack(tags); | |
if (tags && tags[0].length) { | |
var numTags = tags[0].length / 9; | |
var tagNames = ''; | |
for (var i = 0; i < numTags; i++) { | |
tagNames += tags[0][9 * i] + ' '; | |
} | |
console.log(JSON.stringify(tagNames)); | |
// WS.say(tagNames); | |
} | |
}); | |
})} | |
window.onload = main; | |
</script> | |
</body> | |
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{"name":"Costello Myo"} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment