Baumer堡盟相机SDK开发示例

Baumer堡盟相机SDK开发示例(C#调用)

简介
工作中使用到堡盟的彩色相机,在此将调用SDK采集图像相关内容进行整理记录。

开发环境
Windows7
VS2013 64位
halcon12
之所以用到halcon,是因为获取到相机采集的图像后,需要利用halcon图像库进行处理,所以直接将图像转换为halcon库可以处理的格式。

引用库文件
在VS中创建项目,根据自己的环境引用对应的文件。
32-Bit:
\Components\Dev\C_Sharp\Win32\
bgapi2_genicam_dotnet.dll
64-Bit
\Components\Dev
bgapi2_genicam_dotnet.dll

将下列四个文件复制到项目的生产目录中
32-Bit:
\Components\Bin\Win32\目录下
bgapi2_genicam.dll
bgapi2_img.dll
bopfdrvctl.dll
MathParser.dll
64-Bit
\Components\Bin\x64\目录下
bgapi2_genicam.dll
bgapi2_img.dll
bopfdrvctl.dll
MathParser.dll

编写相机类CameraClass

public CameraClass(string id)
{
   this.cameraSN = id;
}
public int connect()//连接相机函数,返回0成功返回-1失败
{
    try
    {
       imgProcessor = BGAPI2.ImageProcessor.Instance;
       if (imgProcessor.NodeList.GetNodePresent("DemosaicingMethod") == true)
       {
          imgProcessor.NodeList["DemosaicingMethod"].Value = "NearestNeighbor"; 
       }
       systemList = BGAPI2.SystemList.Instance;
       systemList.Refresh();//刷新系统列表
       if (systemList.Count == 0)
       {
           //没有找到系统
           return -1;
  • 5
    点赞
  • 35
    收藏
    觉得还不错? 一键收藏
  • 33
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 33
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值