Open CV分别读取图像的蓝绿红通道

来源:互联网 发布:斐波那契数列 python 编辑:程序博客网 时间:2024/05/05 01:09
//image 为读入的原彩色图像
 
Mat imageblue,imagegreen,imagered; 
    vector<Mat>channels; 
   split(image,channels);

imageblue=channels.at(0);
imagegreen=channels.at(1);
imagered=channels.at(2);
unsigned char *bvalue=imageblue.data;
unsigned char *gvalue=imagegreen.data;
unsigned char *rvalue=imagered.data;

//最后在显示彩色图像的时候再用merge函数将蓝绿红通道合成彩色图像显示

merge(channels,image);   
1 0
原创粉丝点击