AForge.NET SobelEdgeDetector (C#)
2012-09-16 08:18
232 查看
http://zip.nvp.com.tw/forum.php?mod=viewthread&tid=2301&extra=page%3D15
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_SobelEdgeDetector_CSharp { public partial class Form1 : Form { public Form1() { InitializeComponent(); } private void button1_Click(object sender, EventArgs e) { Bitmap sourceImage, filteredImage; Bitmap temp; SobelEdgeDetector filter = new SobelEdgeDetector(); sourceImage = (Bitmap)System.Drawing.Image.FromFile(Application.StartupPath + @"..\..\..\sample2.jpg"); 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 CannyEdgeDetector (C#)
- AForge.NET otsu 二值化(C#)
- C# 启动Windows摄像头类 使用Aforge.net
- AForge.NET IterativeThreshold (C#)
- (原創) 如何實現Real Time的Sobel Edge Detector? (SOC) (Verilog) (Image Processing) (DE2) (TRDB-DC2)
- (原創) 如何將DE2_70_TV範例加上Sobel Edge Detector? (SOC) (Verilog) (Image Processing) (DE2-70)
- AForge.NET ContrastStretch 對比度拉升(C#)
- AForge.NET是一个专门为开发者和研究者基于C#框架设计的视频录像
- AForge.net c#下实现Matlab
- C#使用Aforge.net framework采集摄像头视频
- AForge.NET DirectShow (C#)
- c# 使用AForge.NET操作摄像头操作代码
- 如何實現Real Time的Sobel Edge Detector? (SOC) (Verilog) (Image Processing) (DE2-70) (TRDB-D5M) (TRDB-LTM)
- AForge.NET TransformFromPolar (C#)
- AForge.NET DirectShow (C#)
- Webcam in C#: AForge.NET (转)
- AForge.NET ConnectedComponentsLabeling 組件標記 (C#)
- 每天进步一点点------如何实现Sobel Edge Detector? (Image Processing) (C/C++)
- 使用Edge.js,在JavaScript中调用C# .Net
- (原創) 如何實現Sobel Edge Detector? (Image Processing) (C/C++) (C++/CLI) (C)