Hi people!
I am new here and after fruitless searching extensively here and on the web, I hope to find help here now
I just started working on my first PWA using OpenCV.js for image processing. I tried building a custom OpenCV.js file, but after no progress decided to go with the stock versions, e.g. from here.
While some functions work fine, others throw errors. Sometimes these are essential ones, like the cv.Scalar one.
Here’s a code snippet:
cv.threshold(outImg1, threshold_img, 252, 255, cv.THRESH_BINARY);
let m = cv.moments(threshold_img, true) // m = moments(threshold_img, true);
let sunPos = new cv.Point(m.m10 / m.m00, m.m01 / m.m00);
console.log(sunPos)
const circleColor = cv.Scalar(0, 0, 130);
cv.circle(imgWithSunDetected, sunPos, 5, circleColor, 10);
It works all fine up to the cv.Scalar line.
If that is included I get the following error:
this.push is not a function
TypeError: this.push is not a function
at Object.Scalar (http://localhost:3000/static/js/bundle.js:9206:14)
at detectSun
Am I doing something wrong? Other functions like cv.blur
do not work either. I also get the same result whatever version I use (tried 4.8.0, 4.7.0, 3.4.16…). What works, seems to be very limited to me.
Any help apprechiated
Moritz
PS: I am using wsl on windows and inside react.