Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

you can use multiply:

Mat a(1,1,CV_8UC3,Scalar(20,40,60));
cerr << a << endl;
multiply(a, Scalar(1.2,0.5,.2), a);
cerr << a << endl;

[ 20,  40,  60]
[ 24,  20,  12]

(i can only guess, but since the * operator applied on Mat is a matrix multiplication, which does not make sense for a Scalar, there is no overload for *=)