Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

both Mat's need the same number of channels for this, so you have to convert the 8UC1 one:

Mat uc1 = ...
Mat uc3;
cvtColor(uc1, uc3, COLOR_GRAY2BGR);

Mat res;
multiply(mat, uc3, res, CV_16UC3); // choose larger depth, to avoid saturation !