Accessing RGB Values of an Image can be done either by the Method showed in Accessing certain pixel RGB value in openCV
valRed = image.at<cv::Vec3b>(row,col)[0]; //R
valGreen = image.at<cv::Vec3b>(row,col)[1]; //G
valBlue = image.at<cv::Vec3b>(row,col)[2]; //B
Compute your new values and write them to another image using:
image.at<cv::Vec3b>(row,col)[0] = newval[0]; //R
image.at<cv::Vec3b>(row,col)[1] = newval[1]; //G
image.at<cv::Vec3b>(row,col)[2] = newval[2]; //B
or, if you really want to use split (and create 3 new images, one per channel), you can use this:
split(img , colors);
Read:
valRed = colors[0].at<uchar>(row,col)
valGreen = colors[1].at<uchar>(row,col)
valBlue = colors[2].at<uchar>(row,col)
Write:
colors[0].at<uchar>(row,col) = newValRed; //R
colors[1].at<uchar>(row,col) = newValGreen; //G
colors[2].at<uchar>(row,col) = newValBlue; //B