• VisionPro相机操作学习


    private string path = AppDomain.CurrentDomain.BaseDirectory + "12.vpp";
    private string path1 = AppDomain.CurrentDomain.BaseDirectory + "CCD.vpp";
    private string path2 = AppDomain.CurrentDomain.BaseDirectory + "Tool.vpp";
    private CogToolBlock tb;
    private CogToolBlock tb1;
    private CogAcqFifoTool acq;
    private CogAcqFifoTool acq1;
    public Form1()
    {
    InitializeComponent();
    //序列化CogFifoTool 工具
    tb = CogSerializer.LoadObjectFromFile(path) as CogToolBlock;
    //加载到CogToolBlockEdit控件中
    cogToolBlockEditV21.Subject = tb;
    // 转换成取像
    acq = tb.Tools[0] as CogAcqFifoTool;

    }

    private void button1_Click(object sender, EventArgs e)
    {
    acq.Run();
    cogRecordDisplay1.Image = acq.OutputImage;
    cogRecordDisplay1.Fit();
    }

    private void button2_Click(object sender, EventArgs e)
    {
    //初始化相机工具
    acq1 = CogSerializer.LoadObjectFromFile(path1) as CogAcqFifoTool;
    acq1.Run();
    cogRecordDisplay1.Image = acq1.OutputImage;
    cogRecordDisplay1.Fit();
    }

    private void btnLive_Click(object sender, EventArgs e)
    {
    //相机实时状态
    if (cogRecordDisplay1.LiveDisplayRunning)
    {

    cogRecordDisplay1.StopLiveDisplay();
    btnLive.BackColor = Color.Gray;
    }
    else
    {
    cogRecordDisplay1.StartLiveDisplay(acq.Operator, true);
    btnLive.BackColor = Color.Green;
    }
    // cogRecordDisplay1.StartLiveDisplay(acq.Operator);
    }

    private void btnStop_Click(object sender, EventArgs e)
    {
    //关闭实时状态
    cogRecordDisplay1.StopLiveDisplay();
    }

    private void button3_Click(object sender, EventArgs e)
    {
    acq.Run();
    tb1.Inputs["InputImage"].Value = acq.OutputImage;
    tb1.Run();
    cogRecordDisplay1.Record = tb1.CreateLastRunRecord().SubRecords[1];

    //显示运行记录
    //cogRecordDisplay1.Image = acq.OutputImage;
    //cogRecordDisplay1.Record = tb1.CreateLastRunRecord();
    }

    private void Form1_Load(object sender, EventArgs e)
    {
    tb1 = CogSerializer.LoadObjectFromFile(path2) as CogToolBlock;
    cogToolBlockEditV22.Subject = tb1;
    }
    }

  • 相关阅读:
    VB.net byval和byref
    IOS 常用宏定义(二)
    目录权限Linux存储实验四:NFS的安装与配置
    服务器负载均衡nginx+keepalived 高可用负载均衡
    博客文件第二部分 Linux Shell高级编程技巧——第一章 深入讨论
    查看进程第二部分 Linux Shell高级编程技巧——第二章 Shell工具
    响应命令使用Ubuntu架设ftp服务器
    进程内存Linux下top命令
    客户端服务器SSH原理和使用
    安装数据空间虚拟CentOS访问Windows下共享文件
  • 原文地址:https://www.cnblogs.com/MyVision/p/11049285.html
Copyright © 2020-2023  润新知