node-opencv/examples/addweighted.js
punnerud 7c37842094 Update addweighted.js
Corrected the example and tmp-path
2016-01-25 16:18:28 +01:00

15 lines
421 B
JavaScript
Executable File

var cv = require('../lib/opencv');
cv.readImage("./files/mona.png", function(err, orig) {
if (err) throw err;
cv.readImage("./files/over_text.png", function(err, over_text) {
if (err) throw err;
var result = new cv.Matrix(orig.width(), orig.height());
result.addWeighted(orig, 0.7, over_text, 0.9);
result.save("./tmp/weighted.png");
console.log('Image saved to ./tmp/weighted.png');
});
});