opencv-js icon indicating copy to clipboard operation
opencv-js copied to clipboard

img.reshape is not a function

Open teddybee opened this issue 1 year ago • 1 comments

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 avatar Feb 02 '24 02:02 teddybee

img.resize(50) throws the same error

teddybee avatar Feb 21 '24 13:02 teddybee