C#图像平滑与去噪噪声模型、均值滤波与中值滤波、灰度形态学滤波、小波变换去噪、高斯低通滤波、统计滤波


C#语言、VS2005,包括噪声模型、均值滤波与中值滤波、灰度形态学滤波、小波变换去噪、高斯低通滤波、统计滤波
资源截图
代码片段和文件信息
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;

namespace smooth
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
        }

        private void open_Click(object sender EventArgs e)
        {
            OpenFileDialog opnDlg = new OpenFileDialog();
            opnDlg.Filter = “所有图像文件 | *.bmp; *.pcx; *.png; *.jpg; *.gif;“ +
                “*.tif; *.ico; *.dxf; *.cgm; *.cdr; *.wmf; *.eps; *.emf|“ +
                “位图( *.bmp; *.jpg; *.png;...) | *.bmp; *.pcx; *.png; *.jpg; *.gif; *.tif; *.ico|“ +
                “矢量图( *.wmf; *.eps; *.emf;...) | *.dxf; *.cgm; *.cdr; *.wmf; *.eps; *.emf“;
            opnDlg.title = “打开图像文件“;
            opnDlg.ShowHelp = true;
            if (opnDlg.ShowDialog() == DialogResult.OK)
            {
                curFileName = opnDlg.FileName;
                try
                {
                    curBitmap = (Bitmap)Image.FromFile(curFileName);
                }
                catch (Exception exp)
                {
                    MessageBox.Show(exp.Message);
                }
            }
            Invalidate();
        }

        private void close_Click(object sender EventArgs e)
        {
            this.Close();
        }

        private void Form1_Paint(object sender PaintEventArgs e)
        {
            Graphics g = e.Graphics;
            if (curBitmap != null)
            {
                g.DrawImage(curBitmap 160 20 curBitmap.Width curBitmap.Height);
            }
        }

        private void noise_Click(object sender EventArgs e)
        {
            if (curBitmap != null)
            {
                noiseModel noise = new noiseModel();
                if (noise.ShowDialog() == DialogResult.OK)
                {
                    Rectangle rect = new Rectangle(0 0 curBitmap.Width curBitmap.Height);
                    System.Drawing.Imaging.BitmapData bmpData = curBitmap.LockBits(rect System.Drawing.Imaging.ImageLockMode.ReadWrite curBitmap.PixelFormat);
                    IntPtr ptr = bmpData.Scan0;
                    int bytes = curBitmap.Width * curBitmap.Height;
                    byte[] grayValues = new byte[bytes];
                    System.Runtime.InteropServices.Marshal.Copy(ptr grayValues 0 bytes);
                    double temp = 0;
                    byte flagNoise = noise.GetFlag;
                    double[] paraNoise = new double[2];
                    paraNoise = noise.GetParaN;

                    Random r1 r2;
                    double v1 v2;
                    r1 = new Random(unchecked((int)DateTime.Now.Ticks));
                    r2 = new Random(~unchecked((int)DateTime.Now.Ticks));

                    for (int i = 0; i < bytes; i++)
                    {
                

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----

     文件    1440054  2008-08-22 15:07  图像平滑与去噪7中值滤波结果.bmp

     文件     381974  2008-08-22 11:26  图像平滑与去噪7噪声模型.bmp

     文件     192550  2008-08-22 15:03  图像平滑与去噪7均值与中值.bmp

     文件    1440054  2008-08-22 15:05  图像平滑与去噪7均值滤波结果.bmp

     文件     798822  2008-03-01 11:15  图像平滑与去噪7小波分解.bmp

     文件      41984  2008-02-02 16:53  图像平滑与去噪7小波变换.vsd

     文件    1440054  2008-02-02 16:26  图像平滑与去噪7小波变换后图像.bmp

     文件     432178  2008-08-23 14:07  图像平滑与去噪7小波变换对话框.bmp

     文件    1440054  2008-08-22 11:22  图像平滑与去噪7指数噪声.bmp

     文件    1440054  2008-01-24 10:53  图像平滑与去噪7椒盐噪声.bmp

     文件     150654  2008-08-22 18:28  图像平滑与去噪7灰度形态学对话框.bmp

     文件    1440054  2008-08-22 18:29  图像平滑与去噪7灰度形态学滤波.bmp

     文件    1440054  2008-08-22 11:25  图像平滑与去噪7瑞利噪声.bmp

     文件     195054  2008-08-23 15:14  图像平滑与去噪7统计平滑方法对话框.bmp

     文件    1440054  2008-08-23 15:16  图像平滑与去噪7统计方法滤波后图像.bmp

     文件    1440054  2008-01-24 10:51  图像平滑与去噪7高斯噪声.bmp

     文件    1440054  2008-03-10 10:53  图像平滑与去噪7高斯滤波后图像.bmp

     文件     135414  2008-08-23 14:39  图像平滑与去噪7高斯滤波对话框.bmp

     文件      73728  2008-09-05 10:17  图像平滑与去噪7程序smoothsmoothinDebugsmooth.exe

     文件     112128  2008-09-05 10:17  图像平滑与去噪7程序smoothsmoothinDebugsmooth.pdb

     文件       5632  2005-12-08 14:51  图像平滑与去噪7程序smoothsmoothinDebugsmooth.vshost.exe

     文件      69266  2008-09-05 10:17  图像平滑与去噪7程序smoothsmoothForm1.cs

     文件       6571  2008-08-23 14:39  图像平滑与去噪7程序smoothsmoothForm1.Designer.cs

     文件       5814  2008-08-23 14:39  图像平滑与去噪7程序smoothsmoothForm1.resx

     文件        745  2008-09-03 22:17  图像平滑与去噪7程序smoothsmoothgauss.cs

     文件       3714  2008-09-03 22:16  图像平滑与去噪7程序smoothsmoothgauss.Designer.cs

     文件       5814  2008-08-22 10:32  图像平滑与去噪7程序smoothsmoothgauss.resx

     文件        879  2008-09-03 21:05  图像平滑与去噪7程序smoothsmoothmeanMedian.cs

     文件       5612  2008-09-03 21:05  图像平滑与去噪7程序smoothsmoothmeanMedian.Designer.cs

     文件       5814  2008-08-22 11:45  图像平滑与去噪7程序smoothsmoothmeanMedian.resx

............此处省略49个文件信息

版权声明:本文内容由互联网用户自发贡献,该文观点仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容, 请发送邮件举报,一经查实,本站将立刻删除。

发表评论

评论列表(条)