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
import * as opencv from 'opencv';
opencv.readImage('img/sc1.png', (err, imWork) => {
let result = imWork.matchTemplate('img/number/w0.png', 3);
result[0].save('test/test.png');
});
However, the following error occurs:
import * as opencv from 'opencv';
opencv.readImage('img/sc1.png', (err, imWork) => {
opencv.readImage('img/number/w0.png', (err, imNum) => {
imWork.matchTemplate(imNum, 3);
});
});
OpenCV(3.4.1) Error: Assertion failed ((depth == 0 || depth == 5) && type == _templ.type() && _img.dims() <= 2) in cv::matchTemplate, file C:\build\master_winpack-build-win64-vc14\opencv\modules\imgproc\src\templmatch.cpp, line 1102
Please tell me what I miss something.
I think the first way is to read the image file from disk every time.
Seeing the source src/Matrix.cc, opencv.Matrix.matchTemplate() requires (string, unsigned int) as its arguments, and opencv.Matrix.matchTemplateByMatrix() does (opencv.Matrix, unsigned int).
The following is very well:
However, the following error occurs:
Please tell me what I miss something.
I think the first way is to read the image file from disk every time.
I've already checked the following link:
#387
But it was not for my case.
Please help me.
The text was updated successfully, but these errors were encountered: