我正在使用OpenCV for NodeJS(Github repo),并且正在执行具有多个匹配项的模板匹配。这是我的代码:
const cv = require('opencv4nodejs');
const board = cv.imread('img/chessboard.png');
const blackPawn = cv.imread('img/black_pawn.png');
const blackPawnMatch = board.matchTemplate(blackPawn, 5);
var match = blackPawnMatch.findNonZero();
调用findNonZero()时出现此错误:
Mat :: FindNonZero-OpenCV错误:findNonZero中的(src.type()== CV_8UC1),在文件... / node_modules / opencv-build / opencv / opencv / modules / core / src / count_non_zero.cpp中, 396行,状态为-215