node-opencv/examples/camera.js
2014-10-02 23:41:56 +02:00

13 lines
271 B
JavaScript
Executable File

var cv = require('../lib/opencv');
var camera = new cv.VideoCapture(0);
var window = new cv.NamedWindow('Video', 0)
setInterval(function() {
camera.read(function(err, im) {
if (err) throw err;
window.show(im);
window.blockingWaitKey(0, 50);
});
}, 20);