mirror of
https://github.com/peterbraden/node-opencv.git
synced 2025-12-08 19:45:55 +00:00
Update addweighted.js
Corrected the example and tmp-path
This commit is contained in:
parent
3d06aefe75
commit
7c37842094
@ -1,14 +1,14 @@
|
|||||||
var cv = require('../lib/opencv');
|
var cv = require('../lib/opencv');
|
||||||
|
|
||||||
cv.readImage("./examples/files/mona.png", function(err, orig) {
|
cv.readImage("./files/mona.png", function(err, orig) {
|
||||||
if (err) throw err;
|
if (err) throw err;
|
||||||
|
|
||||||
cv.readImage("./examples/files/over_text.png", function(err, over_text) {
|
cv.readImage("./files/over_text.png", function(err, over_text) {
|
||||||
if (err) throw err;
|
if (err) throw err;
|
||||||
|
|
||||||
var result = new cv.Matrix(orig.width(), orig.height());
|
var result = new cv.Matrix(orig.width(), orig.height());
|
||||||
result.addWeighted(orig, 0.7, over_text, 0.9);
|
result.addWeighted(orig, 0.7, over_text, 0.9);
|
||||||
result.save("./examples/tmp/weighted.png");
|
result.save("./tmp/weighted.png");
|
||||||
console.log('Image saved to ./examples/tmp/weighted.png');
|
console.log('Image saved to ./tmp/weighted.png');
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user