结果,给我一个黑色的图像。我尝试将convert与差异参数一起使用,out.convertTo(out,6)
但没有成功。
export function testAction(req, res) {
req.file('image').upload((error, file) => {
openCV.readImage(file[0].fd, function (err, im1) {
let out = im1.matchTemplate(file[1].fd, 0);
out.save('result.png');
});
});
res.ok();
}
匹配模板为您提供Mat中的float元素,范围为[0; 1]。保存图像时,它将转换为CV_8UC3图像,但缩放比例不正确。您可以尝试将结果乘以255,然后查看或使用cv :: normalize方法。
本文收集自互联网,转载请注明来源。
如有侵权,请联系 [email protected] 删除。
我来说两句