1 | initial version |
You also can use mixChannels() function:
Mat result_channel(rows, cols, CV_8UC3);
Mat in[] = { blue_channel, green_channel, red_channel };
int from_to[] = { 0,0, 1,1, 2,2 };
mixChannels( in, 3, &result_channel, 1, from_to, 3 );