如何将3元素向量构造函数与OpenCV中的Mat相乘? 我尝试了以下但是它引发了一个错误:
cv::multiply(src, cv::Vec<_Tp, 3>(2.0, 1.0, 1.0), src);
它出现以下错误:
OpenCV Error: Assertion failed (src2.type() == CV_64F && (src2.rows == 4 || src2.rows == 1)) in arithm_op, file /Users/abhishek/Documents/OpenCV-2.4.3/modules/core/src/arithm.cpp, line 1275
libc++abi.dylib: terminate called throwing an exception
答案 0 :(得分:1)
你试过了吗?
cv::multiply(src, cv::Scalar(2.0, 1.0, 1.0), src);