You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi, following code gives me an argument type error:
// img is of type Mat
const imgGray = new cv.Mat();
cv.cvtColor(img, imgGray, cv.COLOR_RGBA2GRAY);
const imgBlur = new cv.Mat();
cv.GaussianBlur(imgGray, imgBlur, new cv.Size(5, 5), 0, 0, cv.BORDER_DEFAULT);
const imgThresh = new cv.Mat();
cv.threshold(imgBlur, imgThresh, 0, 255, cv.THRESH_BINARY + cv.THRESH_OTSU);
const contours = new cv.MatVector();
const hierarchy = new cv.Mat();
cv.findContours(imgThresh, contours, hierarchy, cv.RETR_CCOMP, cv.CHAIN_APPROX_SIMPLE);
This is the error i am receving:
TS2769: No overload matches this call.
Overload 1 of 2, '(image: Mat, contours: Mat, hierarchy: Mat, mode: number, method: number, offset?: Point): void', gave the following error.
Argument of type 'MatVector' is not assignable to parameter of type 'Mat'.
Type 'Vector<Mat>' is missing the following properties from type 'Mat': allocator, cols, data, data8S, and 67 more.
Overload 2 of 2, '(image: Mat, contours: Mat, mode: number, method: number, offset?: Point): void', gave the following error.
Argument of type 'MatVector' is not assignable to parameter of type 'Mat'.
14 | const hierarchy = new cv.Mat();
15 |
> 16 | cv.findContours(imgThresh, contours, hierarchy, cv.RETR_CCOMP, cv.CHAIN_APPROX_SIMPLE);
| ^^^^^^^^
17 | let maxArea = 0;
18 | let maxContourIndex = -1;
19 | // for (let i = 0; i < contours.size(); ++i) {
Found 1 error in 405 ms.
I've been reading the documentation for opencv js and we are informed that contours should be a MatVector, but types says otherwise. Any ideas of workaround? Local settings?
Using 4.8.0-release.9
The text was updated successfully, but these errors were encountered:
I'm running into the same issue with cv.merge(). This code works in version 4.8.0-release.4, but not in version 4.8.0-release.9:
const channels = new cv.MatVector();
cv.split(mat, channels);
cv.merge(channels, mat);
In 4.8.0-release.9, it gives the error:
error TS2345: Argument of type 'MatVector' is not assignable to parameter of type 'Mat'.
Type 'Vector<Mat>' is missing the following properties from type 'Mat': allocator, cols, data, data8S, and 67 more.
Hi, following code gives me an argument type error:
This is the error i am receving:
I've been reading the documentation for opencv js and we are informed that contours should be a MatVector, but types says otherwise. Any ideas of workaround? Local settings?
Using 4.8.0-release.9
The text was updated successfully, but these errors were encountered: