Add scalar to particular channel of an opencv image?
What is the most efficient way to add scalar to a particular channel of an opencv image?
in c++, you can literally add/subtract Scalars, like:
img -= Scalar(0,0,57); // less red.
we should make a habbit of posting answers instead of comments ^_^
Asked: 2015-09-16 08:21:52 -0600
Seen: 2,268 times
Last updated: Sep 16 '15
Have you tried
image + cv::Scalar(alpha, blue, green, red)
? You just need to put 0 on the channels you do not need, and the value you need on the wanted channel.isn't it
image + cv::Scalar(blue, green, red,alpha)
maybe, I was not sure about the order of the channels :)
be sure http://docs.opencv.org/master/d4/da8/...