1、从文件获取图片,并显示在picturebox里面
Image<Bgr, byte> = new Image<Bgr, byte>(opdlg.FileName);
pictureBox1.Image = img.ToBitmap();
2、将彩色转换为灰度
Image<Gray, byte> gray= src.Convert<Gray, byte>(); //将源图像转换成灰度图像
pictureBox1.Image = grayimg.ToBitmap(); //显示灰度图像
3、将灰度转换为二值图像
//对灰度图像二值化
Image<Gray, Byte> imageThreshold = grayimg.ThresholdBinary(new Gray(temp), new Gray(255));
pictureBox1.Image = imageThreshold.ToBitmap();
4、将Bitmap 转换为灰度
Bitmap bt1 = new Bitmap(@"C:UsersGAOXIANGDesktopI.jpg");
Image<Gray, byte> img1 = new Image<Gray, byte>(bt1);
最后
以上就是魁梧发卡最近收集整理的关于c# OpenCV Emgu学习的全部内容,更多相关c#内容请搜索靠谱客的其他文章。
本图文内容来源于网友提供,作为学习参考使用,或来自网络收集整理,版权属于原作者所有。
发表评论 取消回复