91av视频/亚洲h视频/操亚洲美女/外国一级黄色毛片 - 国产三级三级三级三级

資源簡介

LOG算子 Kirsch算子 Laplace算子 Prewitt算子 Sobel算子 Hough變換 最佳閾值分割 差影法 運用上述方法進行邊緣檢測

資源截圖

代碼片段和文件信息

/************************************************************************
?*?數字圖像處理--VC#.NET編程與實驗?第8章?圖像分割
?*?ImageSegmentation.Form1.cs
?*?Version?1.0?2010.01.29
?*?Author??Xie-Hua?Sun?
?************************************************************************/
using?System;
using?System.Collections.Generic;
using?System.ComponentModel;
using?System.Data;
using?System.Drawing;
using?System.Text;
using?System.Windows.Forms;

namespace?ImageSegmenation
{
????public?partial?class?Form1?:?Form
????{
????????Bitmap?curBitmap?=?null;
????????int?iw?ih;

????????public?Form1()
????????{
????????????InitializeComponent();
????????????label1.Text?=?““;
????????????label2.Text?=?““;
????????}

????????//打開????????
????????private?void?menuItem2_Click(object?sender?EventArgs?e)
????????{
????????????OpenFileDialog?open?=?new?OpenFileDialog();
????????????open.Filter?=?“圖像文件(*.bmp;*.jpg;*gif;*png;*.tif;*.wmf)|“
????????????????????????+?“*.bmp;*jpg;*gif;*png;*.tif;*.wmf“;
????????????if?(open.ShowDialog()?==?DialogResult.OK)
????????????{
????????????????try
????????????????{
????????????????????curBitmap?=?(Bitmap)Image.FromFile(open.FileName);
????????????????}
????????????????catch?(Exception?exp)?{?MessageBox.Show(exp.Message);?}

????????????????pictureBox1.Refresh();
????????????????pictureBox1.Image?=?curBitmap;
????????????????label1.Text?=?“原圖“;
????????????????iw?=?curBitmap.Width;
????????????????ih?=?curBitmap.Height;
????????????}????????????
????????}

????????//保存
????????private?void?menuItem3_Click(object?sender?EventArgs?e)
????????{
????????????string?str;

????????????SaveFileDialog?saveFileDialog1?=?new?SaveFileDialog();
????????????saveFileDialog1.Filter?=?“圖像文件(*.BMP)|*.BMP|All?File(*.*)|*.*“;
????????????saveFileDialog1.ShowDialog();
????????????str?=?saveFileDialog1.FileName;
????????????pictureBox2.Image.Save(str);
????????}

????????//退出
????????private?void?menuItem4_Click(object?sender?EventArgs?e)
????????{
????????????this.Close();
????????}
????????????????
????????//8.1?邊緣檢測===========================================================
????????
????????//Kirsch算子
????????private?void?menuItem10_Click(object?sender?EventArgs?e)
????????{
????????????if?(curBitmap?!=?null)
????????????{
????????????????this.Text?=?“第8章?圖像分割?邊緣檢測?Kirsch算子?作者?孫燮華“;
????????????????Bitmap?bm?=?new?Bitmap(pictureBox1.Image);
????????????????????????????????
????????????????//1:?Kirsch邊緣檢測
????????????????bm?=?detect(bm?iw?ih?1?500);

????????????????pictureBox2.Refresh();
????????????????pictureBox2.Image?=?bm;
????????????????label2.Text?=?“邊緣檢測結果“;
????????????}
????????}

????????/*-------------------------------------------------------------------------
?????????*?pix????--待檢測圖像數組
?????????*?iw?ih?--待檢測圖像寬高
?????????*?num????--算子代號.1:Kirsch算子;2:Laplace算子;3:Prewitt算子;5:Sobel算子
?????????*?thresh?--邊緣檢測閾值T
?????????*?flag???--銳化與邊緣檢測標志?false:銳化;?tru

評論

共有 條評論