Mat element wise multiplication 8UC1 x 8UC3
How do i multiple an single channel mat with a 3 channel mat element wise ?
How do i multiple an single channel mat with a 3 channel mat element wise ?
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 !
Asked: 2017-01-26 22:53:11 -0600
Seen: 1,439 times
Last updated: Jan 27 '17
What is the most effective way to access cv::Mat elements in a loop?
Is there penalty for reference counting in Mat?
Saving an image with unset pixels
android: how to put a column into Mat
Find pixel color out of cv::Mat on specific position
How to update Mat with multiple channels?