阀值处理-----一般应用在二值化上

其他颜色也是可以应用。

以下会生产新的图像。

public Image<TColor, TDepth> ThresholdAdaptive(
	TColor maxValue,
	AdaptiveThresholdType adaptiveType,
	ThresholdType thresholdType,
	int blockSize,
	TColor param1
)
public Image<TColor, TDepth> ThresholdBinary(
	TColor threshold,  
	TColor maxValue
)
public Image<TColor, TDepth> ThresholdBinaryInv(
	TColor threshold,
	TColor maxValue
)
public Image<TColor, TDepth> ThresholdToZero(  //低于值全为0
	TColor threshold
)
public Image<TColor, TDepth> ThresholdToZeroInv( TColor threshold)
//高于值全为255
public Image<TColor, TDepth> ThresholdTrunc(
	TColor threshold      //大于阀值,变成阀值
)
以下是对本图片进行处理:请注意!跟上面是一样模式。
public void _ThresholdBinary(
	TColor threshold,
	TColor maxValue
)
public void _ThresholdBinaryInv(
	TColor threshold,
	TColor maxValue
)
public void _ThresholdToZero(
	TColor threshold
)

public void _ThresholdToZeroInv(
	TColor threshold
)
public void _ThresholdTrunc(
	TColor threshold
)

实例练习学习

 Emgu.CV.Image<Gray,byte> GAY1 = new Image<Gray, byte>((Bitmap)pictureBox2.Image);
            pictureBox5.Image = GAY1.ThresholdBinary(new Gray((int)numericUpDown1.Value), new Gray(250)).Bitmap;
            pictureBox4.Image = GAY1.ToBitmap(); //灰度图片

学习图像处理知识---Emgu3.4 image类学习(六)

 反变二值化

Emgu.CV.Image<Gray,byte> GAY1 = new Image<Gray, byte>((Bitmap)pictureBox2.Image);

            pictureBox5.Image = GAY1.ThresholdBinaryInv(new Gray((int)numericUpDown1.Value), new Gray(250)).Bitmap;
            pictureBox4.Image = GAY1.ToBitmap();

学习图像处理知识---Emgu3.4 image类学习(六)

             pictureBox4.Image = GAY1.ToBitmap();
            pictureBox5.Image = GAY1.ThresholdToZero(new Gray((int)numericUpDown1.Value)).Bitmap;

学习图像处理知识---Emgu3.4 image类学习(六)

          pictureBox4.Image = GAY1.ToBitmap();

            pictureBox5.Image = GAY1.ThresholdToZeroInv(new Gray((int)numericUpDown1.Value)).Bitmap;

学习图像处理知识---Emgu3.4 image类学习(六)

           pictureBox4.Image = GAY1.ToBitmap();

            pictureBox5.Image = GAY1.ThresholdTrunc(new Gray((int)numericUpDown1.Value)).Bitmap;

学习图像处理知识---Emgu3.4 image类学习(六)

自适应阀值

 pictureBox2.Image=YUAN.Convert<Gray,Byte>().ThresholdAdaptive(newGray(250), Emgu.CV.CvEnum.AdaptiveThresholdType.GaussianC,Emgu.CV.CvEnum.ThresholdType.Binary,3,new Gray(0)).ToBitmap();

学习图像处理知识---Emgu3.4 image类学习(六)


相关文章:

  • 2021-05-27
  • 2021-09-28
  • 2021-11-02
  • 2022-01-01
  • 2022-01-11
  • 2021-08-09
  • 2021-10-21
  • 2021-07-09
猜你喜欢
  • 2021-11-08
  • 2021-06-20
  • 2021-06-26
  • 2021-11-12
  • 2021-08-25
  • 2021-12-07
  • 2021-04-01
相关资源
相似解决方案