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?
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,254 times
Last updated: Sep 16 '15
A question about registration function in Opencv2.4.2
Saving an image with unset pixels
opencv_traincascade with same size negatives (as positives)
phase correlation for image registration(image stitching)
Does OpenCV provide Connected Component labeling method for binary image?
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/...