1.图片处理需进行去杂第一个介绍学习(图像执行高斯平滑处理)
public void _SmoothGaussian( int kernelSize //尺寸size(平均点的,3,5,7等) 一定要为奇数,偶数会报错! )
public void _SmoothGaussian( int kernelWidth, int kernelHeight,//同上面尺寸 double sigma1, //水平方向高斯核的标准偏差调暗。 double sigma2 //高斯核的标准偏差在垂直调暗。 )Emgu.CV.Image<Bgr, Byte> YUAN = new Image<Bgr, byte>((Bitmap)pictureBox1.Image);
YUAN._SmoothGaussian(21,21,10,10); //一定要为奇数,偶数会报错!如下图
pictureBox2.Image = YUAN.ToBitmap();
2.各种图像平滑
public Image<TColor, TDepth> SmoothBlur( int width, //不分奇数和偶数 int height )
public Image<TColor, TDepth> SmoothBlur( int width, int height, bool scale //多了一个缩小放大确认 )
public Image<TColor, TDepth> SmoothBilatral( int kernelSize, int colorSigma, int spaceSigma )
public Image<TColor, TDepth> SmoothMedian( int size )
Emgu.CV.Image<Bgr, Byte> YUAN = new Image<Bgr, byte>((Bitmap)pictureBox1.Image); // YUAN.SmoothBlur(500, 20); pictureBox2.Image = YUAN.SmoothBilatral(7,200,100).ToBitmap();//可以给美女美图。其他都是类似用法。
3.有时候还会采用,先降分辨率再升,来进行平滑图片。
public Image<TColor, TDepth> PyrDown()
public Image<TColor, TDepth> PyrUp()
pictureBox2.Image = YUAN.PyrDown().PyrUp().ToBitmap();