Javascript and Webcam with OpenCV putText is not a function [closed]

asked 2019-03-17 15:47:42 -0500

Timo_ gravatar image

Helo,

i have an Raspebrry Pi 3 and want to use it for have an Webinterface to see the Livestream from the webcam. With OpenCV i will to ad some text etc on the Video Stream.

Now i already have a Livestream from the webcam to an webinterface. For this i use the Code from here: https://github.com/kiriapurv/node-camera

To use OpenCV in Javscript i use this: (https://github.com/justadudewhohacks/opencv4nodejs

in the main.js file i have try this: var cv = require('opencv4nodejs');

....

var frameCallback = function (image) {

console.log("Funktion: frameCallback");

//image.putText (text, Punkt, 1 , 10, Farben , 1 , 1, 1, false);

var font = cv.FONT_HERSHEY_SIMPLEX cv.putText(image,'Test',(10,500), font, 4,(255,255,255),2,cv.LINE_AA)

var frame = {

    type: "frame",

    frame: new Buffer(image, "ascii").toString("base64")

};

//umwandlung in ein String Fromat

var raw = JSON.stringify(frame);

for (var index in clients) {

    clients[index].send(raw);

}

};

But i geht this error:

TypeError: image.putText is not a function at frameCallback (/home/pi/node-camera/src/main.js:66:11) terminate called after throwing an instance of 'std::runtime_error' what(): OpenCV Error: (key_ != -1 && "Can't fetch data from terminated TLS container.") in getData, in file /home/pi/opencv-3.4.3/modules/core/src/system.cpp, line 1593, status -215

can someone help me ? Do you need more information ? Please ask.

edit retag flag offensive reopen merge delete

Closed for the following reason question is off-topic or not relevant by berak
close date 2019-03-18 02:14:51.335171

Comments

i don't think, we can help you from here.

opencv has it's own js wrappers, and they might be incompatible to the 3rdparty implementation you're using.

maybe try to make an issue with the coder / maintainer of that package instead ?

berak gravatar imageberak ( 2019-03-17 17:54:22 -0500 )edit