I work with OpenCV 2.4.11+Qt and try to make a video and change the intensity of the red/blue or green channel but did not find any functions or settings to do this. Does anyone know how to do this?
1 Answers
1
votes
If you just want to change the R/G/B value of one particular pixel, use something like:
cv::Mat img; // suppose this is one frame of the video, in CV_BGR
...
img.at<cv::Vec3b>(idx_row, idx_col) = cv::Vec3b(new_b, new_g, new_r); // change here
If you want to change all values of given channel efficiently without changing other channels, check out How to set given channel of a cv::Mat to a given value efficiently without changing other channels?