Friday, September 7, 2012

Setting Mat Pixels (elements) in OpenCV


This is how you set individual element's color channels of a Mat structure in OpenCV

img.at<cv::Vec3b>(v,u)[0]=B;
img.at<cv::Vec3b>(v,u)[1]=G;
img.at<cv::Vec3b>(v,u)[2]=R;