资源简介
BGRtoGRAY.rar

代码片段和文件信息
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 Emgu.CV;
using Emgu.CV.CvEnum;
using Emgu.CV.Structure;
using System.Runtime.InteropServices;
namespace BGRtoGRAY
{
public partial class ToGrayImage : Form
{
public ToGrayImage()
{
InitializeComponent();
}
private void button1_Click(object sender EventArgs e)
{
if (openFileDialog1.ShowDialog() == DialogResult.OK)
{
//IntPtr ptrImage = CvInvoke.cvLoadImage(openFileDialog1.FileName LOAD_IMAGE_TYPE.CV_LOAD_IMAGE_UNCHANGED);
/* IplImage* 转换为Bitmap */
//图片读取
Image image = new Image(openFileDialog1.FileName);
pictureBox1.Image = image.Bitmap;//ConvertIntPrToBitmap(ptrImage);
Image imageGray = image.Convert();
imageGray.Save(@“C:\temp\b.bmp“);
pictureBox2.Image = imageGray.Bitmap;
//显示灰度图像
//IntPtr grayImage = CvInvoke.cvCreateImage(CvInvoke.cvGetSize(ptrImage) IPL_DEPTH.IPL_DEPTH_8U 1);
//CvInvoke.cvCvtColor(ptrImage grayImage COLOR_CONVERSION.CV_BGR2GRAY);
////pictureBox2.Image = ConvertIntPrToBitmap(grayImage); //用该方法灰度图像会有三个图片
//MIplImage mi = (MIplImage)Marshal.PtrToStructure(grayImage typeof(MIplImage));
//Image image = new Image(mi.width mi.height mi.widthStep mi.imageData);
//pictureBox2.Image = image.ToBitmap();
//CvInvoke.cvReleaseImage(ref ptrImage);
//CvInvoke.cvReleaseImage(ref grayImage);
}
}
/// 将IplImage*转换为Bitmap(注:在OpenCV中IplImage* 对应EmguCV的IntPtr类型)
public static Bitmap ConvertIntPrToBitmap(IntPtr ptrImage)
{
//将IplImage指针转换成MIplImage结构
MIplImage mi = (MIplImage)Marshal.PtrToStructure(ptrImage typeof(MIplImage));
Image image = new Image(mi.width mi.height mi.widthStep mi.imageData);
return image.ToBitmap();
}
}
}
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
文件 5875 2014-08-27 20:14 BGRtoGRAY\BGRtoGRAY\BGRtoGRAY.csproj
文件 828478 2014-08-27 20:20 BGRtoGRAY\BGRtoGRAY\bin\Debug\a.bmp
文件 9728 2014-11-10 16:51 BGRtoGRAY\BGRtoGRAY\bin\Debug\BGRtoGRAY.exe
文件 32256 2014-11-10 16:51 BGRtoGRAY\BGRtoGRAY\bin\Debug\BGRtoGRAY.pdb
文件 11600 2014-11-10 16:51 BGRtoGRAY\BGRtoGRAY\bin\Debug\BGRtoGRAY.vshost.exe
文件 490 2010-03-17 22:39 BGRtoGRAY\BGRtoGRAY\bin\Debug\BGRtoGRAY.vshost.exe.manifest
文件 322048 2014-04-16 12:18 BGRtoGRAY\BGRtoGRAY\bin\Debug\Emgu.CV.dll
文件 42496 2014-04-16 12:18 BGRtoGRAY\BGRtoGRAY\bin\Debug\Emgu.CV.GPU.dll
文件 112128 2014-04-16 12:18 BGRtoGRAY\BGRtoGRAY\bin\Debug\Emgu.CV.GPU.pdb
文件 148820 2014-04-16 12:18 BGRtoGRAY\BGRtoGRAY\bin\Debug\Emgu.CV.GPU.xm
文件 36864 2013-09-23 20:41 BGRtoGRAY\BGRtoGRAY\bin\Debug\Emgu.CV.ML.dll
文件 146004 2013-09-23 20:41 BGRtoGRAY\BGRtoGRAY\bin\Debug\Emgu.CV.ML.xm
文件 8192 2014-04-16 12:18 BGRtoGRAY\BGRtoGRAY\bin\Debug\Emgu.CV.OCR.dll
文件 15872 2014-04-16 12:18 BGRtoGRAY\BGRtoGRAY\bin\Debug\Emgu.CV.OCR.pdb
文件 9792 2014-04-16 12:18 BGRtoGRAY\BGRtoGRAY\bin\Debug\Emgu.CV.OCR.xm
文件 40960 2013-09-23 20:41 BGRtoGRAY\BGRtoGRAY\bin\Debug\Emgu.CV.OpenCL.dll
文件 94430 2013-09-23 20:41 BGRtoGRAY\BGRtoGRAY\bin\Debug\Emgu.CV.OpenCL.xm
文件 929280 2014-04-16 12:18 BGRtoGRAY\BGRtoGRAY\bin\Debug\Emgu.CV.pdb
文件 5632 2014-04-16 12:18 BGRtoGRAY\BGRtoGRAY\bin\Debug\Emgu.CV.Stitching.dll
文件 13824 2014-04-16 12:18 BGRtoGRAY\BGRtoGRAY\bin\Debug\Emgu.CV.Stitching.pdb
文件 1153 2014-04-16 12:18 BGRtoGRAY\BGRtoGRAY\bin\Debug\Emgu.CV.Stitching.xm
文件 113664 2014-04-16 12:18 BGRtoGRAY\BGRtoGRAY\bin\Debug\Emgu.CV.UI.dll
文件 140800 2014-04-16 12:18 BGRtoGRAY\BGRtoGRAY\bin\Debug\Emgu.CV.UI.pdb
文件 35149 2014-04-16 12:18 BGRtoGRAY\BGRtoGRAY\bin\Debug\Emgu.CV.UI.xm
文件 1227431 2014-04-16 12:18 BGRtoGRAY\BGRtoGRAY\bin\Debug\Emgu.CV.xm
文件 25088 2014-04-16 12:17 BGRtoGRAY\BGRtoGRAY\bin\Debug\Emgu.Util.dll
文件 58880 2014-04-16 12:17 BGRtoGRAY\BGRtoGRAY\bin\Debug\Emgu.Util.pdb
文件 22455 2014-04-16 12:17 BGRtoGRAY\BGRtoGRAY\bin\Debug\Emgu.Util.xm
文件 307200 2013-02-09 07:33 BGRtoGRAY\BGRtoGRAY\bin\Debug\ZedGraph.dll
文件 1492968 2013-02-09 07:33 BGRtoGRAY\BGRtoGRAY\bin\Debug\ZedGraph.xm
............此处省略38个文件信息
- 上一篇:FlyingShootGame2.zip
- 下一篇:PADS最全封装库.zip
相关资源
- PID_AutoTune_v0.rar
- vspd7.2.308.zip
- 价值2k的H漫画小说系统
- Pythonamp;课堂amp;笔记(高淇amp;400;集第
- ddos压力测试工具99657
- UML建模大全
- 开源1A锂电池充电板TP4056原理图+PCB
- m1卡 ic卡可选择扇区初始化加密软件
- TSCC.exe
- FTP课程设计(服务端+客户端)
- 计算机图形学 边填充算法实现代码
- 电力系统潮流计算程序集合
- oracle数据迁移项目实施方案
- Web Api 通过文件流 文件到本地
- Visio图标-最新最全的网络通信图标库
- Spire API文档
- OpenGL参考手册
- Python中Numpy库最新教程
- SPD博士V5.3.exe
- 直流无刷电机方波驱动 stm32 例程代码
- layui后台管理模板
- 仿知乎界面小程序源代码
- 云平台-阿里云详细介绍
- photoshop经典1000例
- scratch垃圾分类源码(最终版本).sb
- IAR ARM 7.8破解
- TI CCS V5.4 安装步骤及破解文件
- 松下plc FP-XH的驱动
- 局域网硬件信息收集工具
- 加快Windows XP操作系统开机速度
评论
共有 条评论