visionpro如何保存图片
推荐于2016-02-10 · 知道合伙人IT服务行家
关注
展开全部
保存图像在图像处理中是基本的操作,下面C#语言显示保存图像为IDB格式:
private int tNum;
private CogFrameGrabbers myFrameGrabbers;
private
ICogFrameGrabber myFrameGrabber;
private ICogAcqFifo myAcqFifo;
private CogImageFile myImageFileTool;
private bool logImages;
private void InitializeFifo() //初始化,Sony CX75相机,分辨率640X480
{
const
string VIDEO_FORMAT = "Sony XC75 640x480";
myFrameGrabbers = new
CogFrameGrabbers();
myFrameGrabber = myFrameGrabbers[0];
myAcqFifo = myFrameGrabber.CreateAcqFifo(VIDEO_FORMAT,
Cognex.VisionPro.CogAcqFifoPixelFormatConstants.Format8Grey, 0, false);
myImageFileTool = new CogImageFile();
logImages = false;
}
private void InitializeImageFile() //初始化文件idb1.idb
{
myImageFileTool.Open("C:\\home\\VisionPro\\idb1.idb",
CogImageFileModeConstants.Update);
}
private void button2_Click(object sender, System.EventArgs e)
{
logImages = true; //保存文件开始标志
}
private void button1_Click(object sender, System.EventArgs e)
//显示并保存
{
cogDisplay1.Image = myAcqFifo.Acquire(out tNum);
if (logImages == true)
myImageFileTool.Append(cogDisplay1.Image);
}
private int tNum;
private CogFrameGrabbers myFrameGrabbers;
private
ICogFrameGrabber myFrameGrabber;
private ICogAcqFifo myAcqFifo;
private CogImageFile myImageFileTool;
private bool logImages;
private void InitializeFifo() //初始化,Sony CX75相机,分辨率640X480
{
const
string VIDEO_FORMAT = "Sony XC75 640x480";
myFrameGrabbers = new
CogFrameGrabbers();
myFrameGrabber = myFrameGrabbers[0];
myAcqFifo = myFrameGrabber.CreateAcqFifo(VIDEO_FORMAT,
Cognex.VisionPro.CogAcqFifoPixelFormatConstants.Format8Grey, 0, false);
myImageFileTool = new CogImageFile();
logImages = false;
}
private void InitializeImageFile() //初始化文件idb1.idb
{
myImageFileTool.Open("C:\\home\\VisionPro\\idb1.idb",
CogImageFileModeConstants.Update);
}
private void button2_Click(object sender, System.EventArgs e)
{
logImages = true; //保存文件开始标志
}
private void button1_Click(object sender, System.EventArgs e)
//显示并保存
{
cogDisplay1.Image = myAcqFifo.Acquire(out tNum);
if (logImages == true)
myImageFileTool.Append(cogDisplay1.Image);
}
美狐美颜sdk
2024-08-06 广告
2024-08-06 广告
美颜SDK推出多个版本的原因有以下几点:1. 满足不同平台的需求:美颜SDK的不同版本可以满足不同平台的运营需求。例如,对于直播平台,需要更多的美颜功能来吸引观众,而视频聊天平台则需要的是精简版的美颜功能。通过提供不同版本的美颜SDK,可以...
点击进入详情页
本回答由美狐美颜sdk提供
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询