资源简介
Canny边缘检测是被公认的检测效果最好的边缘检测方法,是由John F. Canny于1986年提出,算法目标是找出一个最优的边缘检测的方法,所谓最优即:1.好的检测:算法能够尽可能的标识出图像的边缘;2.好的定位:标识出的边缘要尽可能的与实际边缘相接近;3.最小响应:图像中的边缘只能标识一次,并且不能把噪声标识成边缘。同时我们也要满足3个准则:信噪比准则、定位精度准则、单边缘响应准则
代码片段和文件信息
using System;
using System.Collections.Generic;
using System.Text;
using System.Drawing.Imaging;
using System.Windows.Forms;
using System.Drawing;
using System.IO;
namespace CannyEdgeDetectionCSharp
{
class Canny
{
public int Width Height;
public Bitmap Obj;
public int[] GreyImage;
//Gaussian Kernel Data
int [] GaussianKernel;
int KernelWeight ;
int KernelSize =5;
float Sigma = 1; // for N=2 Sigma =0.85 N=5 Sigma =1 N=9 Sigma = 2 2*Sigma = (int)N/2
//Canny Edge Detection Parameters
float MaxHysteresisThresh MinHysteresisThresh;
public float[] DerivativeX;
public float[] DerivativeY;
public int[] FilteredImage;
public float[] Gradient;
public float[] NonMax;
public int[] PostHysteresis;
int[] EdgePoints;
public float[] GNH;
public float[] GNL;
public int[] EdgeMap;
public int[] VisitedMap;
public Canny(Bitmap Input)
{
// Gaussian and Canny Parameters
MaxHysteresisThresh = 20F;
MinHysteresisThresh = 10F;
Obj = Input;
Width = Obj.Width;
Height = Obj.Height;
EdgeMap = new int[Width Height];
VisitedMap = new int[Width Height];
ReadImage();
DetectCannyEdges();
return;
}
public Canny(Bitmap Input float Th float Tl)
{
// Gaussian and Canny Parameters
MaxHysteresisThresh = Th;
MinHysteresisThresh = Tl;
Obj = Input;
Width = Obj.Width;
Height = Obj.Height;
EdgeMap = new int[Width Height];
VisitedMap = new int[Width Height];
ReadImage();
DetectCannyEdges();
return;
}
public Canny(Bitmap Input float Th float Tl int GaussianMaskSize float SigmaforGaussianKernel)
{
// Gaussian and Canny Parameters
MaxHysteresisThresh = Th;
MinHysteresisThresh = Tl;
KernelSize = GaussianMaskSize;
Sigma = SigmaforGaussianKernel;
Obj = Input;
Width = Obj.Width;
Height = Obj.Height;
EdgeMap = new int[Width Height];
VisitedMap = new int[Width Height];
ReadImage();
DetectCannyEdges();
return;
}
public Bitmap DisplayImage()
{
int i j;
Bitmap image = new Bitmap(Obj.Width Obj.Height);
BitmapData bitmapData1 = image.LockBits(new Rectangle(0 0 Obj.Width Obj.Height)
ImageLockMode.ReadOnly PixelFormat.Format32bppArgb);
unsafe
{
byte* i
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
目录 0 2010-07-10 20:31 Canny Edge Detection C#\
文件 1540314 2010-07-10 21:11 Canny Edge Detection C#\Canny.bmp
文件 941 2010-07-10 20:02 Canny Edge Detection C#\Canny.sln
文件 20992 2010-07-10 21:10 Canny Edge Detection C#\Canny.suo
文件 746550 2010-07-10 20:26 Canny Edge Detection C#\Shrikrishna.bmp
目录 0 2010-07-10 20:31 Canny Edge Detection C#\Iris Recognition\
文件 21357 2010-07-10 20:28 Canny Edge Detection C#\Iris Recognition\Canny.cs
文件 4584 2010-07-10 20:29 Canny Edge Detection C#\Iris Recognition\CannyEdgeDetection.csproj
文件 3328 2010-07-10 21:09 Canny Edge Detection C#\Iris Recognition\Mainform.cs
文件 20547 2010-07-10 21:09 Canny Edge Detection C#\Iris Recognition\Mainform.Designer.cs
文件 6586 2010-07-10 21:09 Canny Edge Detection C#\Iris Recognition\Mainform.resx
文件 494 2010-07-10 20:28 Canny Edge Detection C#\Iris Recognition\Program.cs
目录 0 2010-07-10 20:31 Canny Edge Detection C#\Iris Recognition\Properties\
文件 1294 2009-07-07 18:28 Canny Edge Detection C#\Iris Recognition\Properties\AssemblyInfo.cs
文件 2873 2010-07-10 20:28 Canny Edge Detection C#\Iris Recognition\Properties\Resources.Designer.cs
文件 5612 2009-07-07 18:28 Canny Edge Detection C#\Iris Recognition\Properties\Resources.resx
文件 1103 2010-07-10 20:28 Canny Edge Detection C#\Iris Recognition\Properties\Settings.Designer.cs
文件 249 2009-07-07 18:28 Canny Edge Detection C#\Iris Recognition\Properties\Settings.settings
目录 0 2010-07-10 20:31 Canny Edge Detection C#\Iris Recognition\obj\
文件 545 2010-07-10 21:10 Canny Edge Detection C#\Iris Recognition\obj\CannyEdgeDetection.csproj.FileList.txt
文件 585 2010-07-10 20:01 Canny Edge Detection C#\Iris Recognition\obj\Iris Recognition.csproj.FileList.txt
文件 1515 2010-07-08 15:50 Canny Edge Detection C#\Iris Recognition\obj\Iris Recognition.csproj.FileListAbsolute.txt
目录 0 2010-07-10 20:31 Canny Edge Detection C#\Iris Recognition\obj\Debug\
文件 53248 2009-07-07 18:31 Canny Edge Detection C#\Iris Recognition\obj\Debug\AxInterop.Project1.dll
文件 845 2010-07-10 21:09 Canny Edge Detection C#\Iris Recognition\obj\Debug\CannyEdgeDetection.csproj.GenerateResource.Cache
文件 734 2010-07-10 20:29 Canny Edge Detection C#\Iris Recognition\obj\Debug\CannyEdgeDetection.csproj.ResolveComReference.cache
文件 36864 2010-07-10 21:09 Canny Edge Detection C#\Iris Recognition\obj\Debug\CannyEdgeDetection.exe
文件 44544 2010-07-10 21:09 Canny Edge Detection C#\Iris Recognition\obj\Debug\CannyEdgeDetection.pdb
文件 180 2010-07-10 21:09 Canny Edge Detection C#\Iris Recognition\obj\Debug\CannyEdgeDetectionCSharp.Mainform.resources
文件 180 2010-07-10 20:29 Canny Edge Detection C#\Iris Recognition\obj\Debug\CannyEdgeDetectionCSharp.Properties.Resources.resources
文件 53248 2010-07-10 20:29 Canny Edge Detection C#\Iris Recognition\obj\Debug\Interop.Project1.dll
............此处省略17个文件信息
- 上一篇:asp.net微信支付接口代码
- 下一篇:IM即时通讯源码C#开发有数据库
相关资源
- IM即时通讯源码C#开发有数据库
- C#实现在线视频聊天语音聊天全源
- c#井字游戏
- 各种版本UDP和TCP小程序
- 基于C#的网上购物系统
- C#文件资源管理器——仿我的电脑
- C#+Access实现小型CRM系统
- C#黑白图像去噪源代码工程
- C# 的设备管理系统
- C#开发的超市商品管理系统
- asp.net(c#)客户关系管理系统CRM
- C#编写的网络间谍程序源代码(监视记
- 开源 爬虫 C#
- C#网络编程实作教程
- c# call tensorflow
- 将sqlserver数据库转换为sqlite数据库的
- 在c#中Teechart的使用说明
- c#库存管理系统192935
- 用access连接的c#图书馆管理系统,对于
- Asp.net房产中介管理系统源码
- VS2010C#+SQLserver下的学生选课系统
- TCP/IP Sockets in C#: Practical Guide for Prog
- TradeX.dll C# 接口演示程序
- 生成和读取条形码二维码C#
- C#_Winform中使用GDI+及双缓冲技术绘制正
- C#+ArcEngine 二次开发,基本的各种功能
- winform简单的增删改查
- C#图像处理六项图片处理功能及截图工
- 员工请假管理 c# SQL
- C#串口波形图
评论
共有 条评论