TechStark / opencv-js

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

Type error when using cv.findContours #34

Closed backrunner closed 9 months ago

backrunner commented 10 months ago
const contours = new cv.MatVector();
const hierarchy = new cv.Mat();
cv.findContours(image, contours, hierarchy, cv.RETR_LIST, cv.CHAIN_APPROX_SIMPLE);

After the cv.findContours executed, contours.size() will be typed as cv.Size, it should be a number.

ewwwgiddings commented 10 months ago

I think this may be a work around for right now? (contours.size() as any as number)

backrunner commented 10 months ago

I think this may be a work around for right now? (contours.size() as any as number)

That's exactly what I'm doing now, but the type issue is still painful🥲

neko-para commented 10 months ago

Seems that mirada is not maintained now 😢 . Does anyone know any alternative?

ttt43ttt commented 10 months ago

The plan is moving the typescript definitions from mirada to this repo. We’ll maintain them here. This is in progress.

ttt43ttt commented 9 months ago

Fixed in v4.8.0-release.6