mirror of
https://github.com/peterbraden/node-opencv.git
synced 2025-12-08 19:45:55 +00:00
added example for mat.put
This commit is contained in:
parent
150fc4a66d
commit
a1a2421b32
14
examples/mat-put.js
Normal file
14
examples/mat-put.js
Normal file
@ -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);
|
||||||
Loading…
x
Reference in New Issue
Block a user