AForge.NET BradleyLocalThresholding (C#)
2012-09-16 08:22
911 查看
http://zip.nvp.com.tw/forum.php?mod=viewthread&tid=2177&extra=page%3D16
using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Linq; using System.Text; using System.Windows.Forms; using System.Drawing.Imaging; using AForge; using AForge.Imaging; using AForge.Imaging.Filters; namespace AForge_BradleyLocalThresholding_CSharp { public partial class Form1 : Form { public Form1() { InitializeComponent(); } private void button1_Click(object sender, EventArgs e) { Bitmap sourceImage, filteredImage; Bitmap temp; BradleyLocalThresholding filter = new BradleyLocalThresholding(); sourceImage = (Bitmap)System.Drawing.Image.FromFile(Application.StartupPath + @"..\..\..\sample20.png"); if (pictureBox1.Image != null) { pictureBox1.Image.Dispose(); pictureBox1.Image = null; } if (pictureBox2.Image != null) { pictureBox2.Image.Dispose(); pictureBox2.Image = null; } temp = AForge.Imaging.Image.Clone(sourceImage, sourceImage.PixelFormat); sourceImage.Dispose(); sourceImage = temp; pictureBox1.Image = sourceImage; filteredImage = filter.Apply(sourceImage.PixelFormat != PixelFormat.Format8bppIndexed ? Grayscale.CommonAlgorithms.BT709.Apply(sourceImage) : sourceImage); pictureBox2.Image = filteredImage; } } } |
相关文章推荐
- AForge.NET DirectShow (C#)
- 【转】Webcam in C#: AForge.NET
- AForge.NET TransformFromPolar (C#)
- C#学习之 调用 AForge.NET框架启动摄像头抓拍
- AForge.NET ConnectedComponentsLabeling 組件標記 (C#)
- AForge.NET是一个专门为开发者和研究者基于C#框架设计的视频录像
- AForge.NET QuadrilateralTransformation (C#)
- AForge.NET BayerFilter (C#)
- AForge.net c#下实现Matlab
- c# 利用AForge.NET组件操作摄像头
- .NET/C#中的隐式类型局部变量(Implicitly Typed Local Variables)
- AForge.NET FillHoles (C#)
- 获取本机已安装的软件列表C#/VB.NET(Get the list of installed software in local pc)
- C#.NET GetLocalMachineInfo.cs
- Aforge.net 一个专门为开发者和研究者基于C#框架设计
- AForge.NET CornersMarker (C#)
- C# 启动Windows摄像头类 使用Aforge.net
- AForge.NET ColorFiltering (C#)
- AForge.NET SobelEdgeDetector (C#)
- C#使用Aforge.net framework采集摄像头视频