将图像转换为图像< gray,float>在C#中 [英] convert image to image<gray,float> in c#

查看:231
本文介绍了将图像转换为图像< gray,float>在C#中的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好

我读取扩展名为.bitmap的图像,然后将结果图像放在图片框中,

I read image with extension .bitmap , then I put the result image in picture box ,

我需要将图片框中的结果图像转换为图像.在另一个函数ss1中使用它,我该怎么办???

I need to convert the resulting  image in picture box to image<Gray,float> to use it in another function ss1  , what should I do????

这是我的代码

图片myImg;

&imageb; myBmp;

 Image myBmp;

  myImg = System.Drawing.Image.FromFile(@ lblFile.Text);

 myImg = System.Drawing.Image.FromFile(@lblFile.Text);

myBmp = 位图(myImg,pictureBox1.Width,pictureBox1.Height);

myBmp = newBitmap(myImg,pictureBox1.Width,pictureBox1.Height);


pictureBox1.Image = myBmp;

public void ss1(

public void ss1 (Image<Gray, float> img)

{.......}

{.......}

推荐答案

任何图像<灰色,浮动>是,它很可能将具有构造函数.所以告诉我们,构造函数需要什么作为参数.

whatever Image<Gray, float> is, it most likely will have a constructor. So show us, what that constructor needs as parameters.

通常,这将简单地使用给定的位图进行初始化.

Typically this will simply be initialized with a given bitmap.

在emgu中,这里的rgb图像将被构造为:

From emgu, here a rgb image will be constructed like:

Image<Bgr, Byte> img =new Image<Bgr, Byte>(bmp);

其中bmp是位图对象.

where bmp is a bitmap object.

http://www.emgu.com/wiki/index.php/Working_with_Images

http://www.emgu.com/wiki/index.php/Working_with_Images

此致

 托尔斯滕


这篇关于将图像转换为图像&lt; gray,float&gt;在C#中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆