问题描述
大家好
我读取扩展名为.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( 图片 < 灰色 , float > img)
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
此致
托尔斯滕
这篇关于将图像转换为图像< gray,float>在C#中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!