Abhishek Thakur
Abhishek Thakur

Reputation: 17005

Vector Constructor and Mat

How can a 3 element vector constructer be multiplied by a Mat in OpenCV? I tried the following but it throws an error:

cv::multiply(src, cv::Vec<_Tp, 3>(2.0, 1.0, 1.0), src);

It gives the following error:

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

Upvotes: 1

Views: 489

Answers (1)

karlphillip
karlphillip

Reputation: 93410

Have you tried:

cv::multiply(src, cv::Scalar(2.0, 1.0, 1.0), src);

Upvotes: 1

Related Questions