TechStark / opencv-js

OpenCV JavaScript version for node.js or browser
Apache License 2.0
357 stars 32 forks source link

how do I get imgproc? #4

Closed mcastillo86 closed 2 years ago

mcastillo86 commented 2 years ago

I've just downloaded this package and I'm doing some code but I'm not able to find "Imgproc". How do I import it?

ttt43ttt commented 2 years ago

Not sure where "Imgproc" is used. Is it throwing an error if your testing?

mcastillo86 commented 2 years ago

No error, I'm doing a code to change the color of certain sections of an image and for that I need Imgproc.

mcastillo86 commented 2 years ago

I manage to workaround that, now I get a "mat.push_back is not a function" message. My code looks like this:

let mat = new cv.Mat(1, 1, cv.CV_32SC3) mat.push_back(0, item[0])

where item is an array of number.

Before I tried to use mat.put but got similar message "mat.put is not a function"

ttt43ttt commented 2 years ago

See document https://docs.opencv.org/3.4/de/d06/tutorial_js_basic_ops.html I think you can try things like mat.data[0] = item[0]