目录
图像以单通道或者多通道组成,gray 只有一个通道。Bgra 由四个通道组 成的彩色图像。接下来讲解图像的通道分离于合成。 EmguCv 中可以采用 CvInvoke 类中的 Split()对通道进行分离.
1、图像通道分离
.Split
split主要是将图像通道进行分离,三通道图像分离出B、G、R三个通道,一般用vectorofMat来承载分离出来的通道图像。
相关代码:
Mat img = new Mat("G:\\Emgucv_Project\\image\\dog.jpg");
Image<Bgr, byte> img1 = new Image<Bgr, byte>(img.Width, img.Height, new Bgr(255, 0, 0));
VectorOfMat mt = new VectorOfMat();
CvInvoke.Split(img1, mt);
pictureBox1.Image = img1.ToBitmap();
pictureBox2.Image = mt[0].ToBitmap();//B
pictureBox3.Image &#