VisionPro二开之相机调试界面

VisionPro二开之相机调试界面

一 设置X64

二 UI设计

txtExposure

三 打开相机

privateCogFrameGrabbersframeGrabbers;// 相机对象privateICogFrameGrabberframeGrabber;/// <summary>/// 采集对象/// </summary>publicICogAcqFifoMyAcfifo{get;set;}publicForm1(){InitializeComponent();frameGrabbers=newCogFrameGrabbers();}/// <summary>/// 打开相机/// </summary>/// <param name="sender"></param>/// <param name="e"></param>privatevoidbutton1_Click(objectsender,EventArgse){if(frameGrabbers.Count>0){// 第一个相机frameGrabber=frameGrabbers[0];try{// 创建相机对象对应采集对象MyAcfifo=frameGrabber.CreateAcqFifo(frameGrabber.AvailableVideoFormats[0],CogAcqFifoPixelFormatConstants.Format8Grey,0,true);MessageBox.Show("打开相机成功");}catch(Exceptionex){Trace.WriteLine($"初始化相机失败,信息为:{ex.Message}");}}}

四 软触发

补充

打开Cognex GigE Vision Configurator(安装VP 默认自带)