From a1a2421b32af290df7c63a3c309209227710b50c Mon Sep 17 00:00:00 2001 From: Thomas Hoffmann Date: Wed, 22 Apr 2015 07:58:30 +0200 Subject: [PATCH] added example for mat.put --- examples/mat-put.js | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 examples/mat-put.js diff --git a/examples/mat-put.js b/examples/mat-put.js new file mode 100644 index 0000000..5f740a3 --- /dev/null +++ b/examples/mat-put.js @@ -0,0 +1,14 @@ +var opencv = require('../lib/opencv'); +var mat = new opencv.Matrix(256,256,opencv.Constants.CV_8UC1); +var buf = Buffer(256*256); +buf.fill(0); +for(var i=0;i<256*256;i++){ + buf[i] = (i%2===1)?230:0; +} +mat.put(buf); +var window = new opencv.NamedWindow('Mat-Put', 0); +window.show(mat); +window.blockingWaitKey(0, 50); +setTimeout(function(){ + // keep the windows 30sec open +},30000);