TechStark / opencv-js

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

img.reshape is not a function #53

Open teddybee opened 5 months ago

teddybee commented 5 months ago

I would like to reshape a Mat. I can see the method in typescript, but when the code runs, it throws this error: img.reshape is not a function

const img = new cv.Mat()  
cv.cvtColor(origImg, img, cv.COLOR_RGBA2RGB )
const vectorized = img.reshape(-1, 3)

What am I missing?

Packages: "@techstark/opencv-js": "^4.9.0-release.2", "vite": "^5.0.12", "react": "^18.2.0",

teddybee commented 4 months ago

img.resize(50) throws the same error