• 大小: 2.04MB
    文件类型: .rar
    金币: 1
    下载: 0 次
    发布日期: 2023-09-19
  • 语言: C#
  • 标签: c#  灰度拉伸  

资源简介

c#数字图像处理之点运算及直方图,包含在c#中对图像进行处理的图像点运算处理(线性点运算、灰度拉伸和直方图绘制、直方图均衡、直方图匹配)的编程实现。

资源截图

代码片段和文件信息

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using System.Drawing.Drawing2D;

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

        private void histogram_Click(object sender EventArgs e)
        {
            if (curBitmap != null)
            {
                histForm histoGram = new histForm(curBitmap);
                histoGram.ShowDialog();
                histoGram.Close();
            }
        }

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

        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 Form1_Paint(object sender PaintEventArgs e)
        {
            Graphics g = e.Graphics;
            if (curBitmap != null)
            {
                g.DrawImage(curBitmap 160 20 curBitmap.Width curBitmap.Height);
            }
        }

        private void linearPO_Click(object sender EventArgs e)
        {
            if (curBitmap != null)
            {
                linearPOForm linearForm = new linearPOForm();

                if (linearForm.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);
                    int temp = 0;
                    double a = Convert.ToDouble(linearForm.GetScaling);
                    double b = Convert.ToDouble(l

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

     文件      64000  2008-08-19 19:20  c#数字图像处理之点运算及直方图\image\Thumbs.db

     文件     389254  2008-08-19 19:18  c#数字图像处理之点运算及直方图\image\匹配.bmp

     文件     858534  2007-09-08 06:19  c#数字图像处理之点运算及直方图\image\添加直方图窗体.bmp

     文件    1744194  2007-09-08 20:48  c#数字图像处理之点运算及直方图\image\灰度拉伸.bmp

     文件    1785114  2007-09-08 21:02  c#数字图像处理之点运算及直方图\image\灰度拉伸结果.bmp

     文件    1976678  2007-09-05 05:48  c#数字图像处理之点运算及直方图\image\直方图.bmp

     文件    1725654  2007-09-22 06:20  c#数字图像处理之点运算及直方图\image\直方图匹配原图.bmp

     文件    1653654  2007-09-22 06:31  c#数字图像处理之点运算及直方图\image\直方图匹配结果.bmp

     文件    1726126  2007-09-10 03:57  c#数字图像处理之点运算及直方图\image\直方图均衡化原图.bmp

     文件    1718914  2007-09-10 04:10  c#数字图像处理之点运算及直方图\image\直方图均衡化结果.bmp

     文件     187254  2008-08-18 23:31  c#数字图像处理之点运算及直方图\image\线性点运算.bmp

     文件    1664334  2007-09-08 05:40  c#数字图像处理之点运算及直方图\image\负片.bmp

     文件      32768  2008-08-19 19:36  c#数字图像处理之点运算及直方图\program\point operation\point operation\bin\Debug\point operation.exe

     文件      54784  2008-08-19 19:36  c#数字图像处理之点运算及直方图\program\point operation\point operation\bin\Debug\point operation.pdb

     文件       5632  2005-12-08 22:51  c#数字图像处理之点运算及直方图\program\point operation\point operation\bin\Debug\point operation.vshost.exe

     文件      10640  2008-08-19 18:46  c#数字图像处理之点运算及直方图\program\point operation\point operation\Form1.cs

     文件       6053  2007-09-14 05:22  c#数字图像处理之点运算及直方图\program\point operation\point operation\Form1.Designer.cs

     文件       5814  2007-09-14 05:22  c#数字图像处理之点运算及直方图\program\point operation\point operation\Form1.resx

     文件       3268  2008-08-19 19:31  c#数字图像处理之点运算及直方图\program\point operation\point operation\histForm.cs

     文件       2329  2008-08-18 04:23  c#数字图像处理之点运算及直方图\program\point operation\point operation\histForm.Designer.cs

     文件       5814  2007-09-15 05:00  c#数字图像处理之点运算及直方图\program\point operation\point operation\histForm.resx

     文件        896  2008-08-18 22:54  c#数字图像处理之点运算及直方图\program\point operation\point operation\linearPOForm.cs

     文件       5336  2008-08-18 22:54  c#数字图像处理之点运算及直方图\program\point operation\point operation\linearPOForm.Designer.cs

     文件       5814  2008-08-18 22:54  c#数字图像处理之点运算及直方图\program\point operation\point operation\linearPOForm.resx

     文件       1032  2008-08-19 19:16  c#数字图像处理之点运算及直方图\program\point operation\point operation\obj\Debug\point operation.csproj.GenerateResource.Cache

     文件      32768  2008-08-19 19:36  c#数字图像处理之点运算及直方图\program\point operation\point operation\obj\Debug\point operation.exe

     文件      54784  2008-08-19 19:36  c#数字图像处理之点运算及直方图\program\point operation\point operation\obj\Debug\point operation.pdb

     文件        180  2008-08-08 03:16  c#数字图像处理之点运算及直方图\program\point operation\point operation\obj\Debug\point_operation.Form1.resources

     文件        180  2008-08-08 03:16  c#数字图像处理之点运算及直方图\program\point operation\point operation\obj\Debug\point_operation.histForm.resources

     文件        180  2008-08-18 22:54  c#数字图像处理之点运算及直方图\program\point operation\point operation\obj\Debug\point_operation.linearPOForm.resources

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

评论

共有 条评论