Gocator Acquisition for Cognex
VisionPro
概述
VisionPro 是个很强大的视觉软件, 我们很乐意我们的客户在 VisionPro 环境中使用 Gocator 产品。
实现方法
在 VisionPro 环境下配置 Gocator 产品两种方法:
● 方法一:
创建一个 QuickBuild Job,在 Job 编辑器添加 Job Script,插入 Gocator 的 SDK,编辑简
单脚本就 OK。
● 方法二:
在.Net 环境中调用 Gocator SDK 以及 VisionPro Dll
详细如下:
在 VisionPro 软件中加载 Gocator 高度图以及亮度图
预装软件
● Cognex VisionPro 9.0
Vision Pro 9 下载链接 here, VisionPro 3D 加密狗或者带 license 的卡.
● Gocator SDK 4.6.7.17
LMI3D 官网. 或者从激光器的帮助链接里:
Gocator SDK 帮助文档你可以获取 Gocator 更多信息;
详细步骤
方法 1 - VisionPro QuickBuild Job 下配置
我们会先打开一副图像, 通过 Job 脚本将 Gocator 的高度信息重写这张图像;
1) 创建 Job,从你电脑硬盘加载一副图像. 这幅图像可以是任意格式,任意大小。详细
步骤见下图:
1)
2) 选择 “
Job Properties” , “Edit Job Script” 进行脚本编辑
3) C#脚本(选择,我下面做的是 C#版本的脚本),VB 脚本
4) 打开 Quickbuild 安装所在文件夹,如图:
5) 将 GoSDK.Dll, GoSDKNet.dll, kApi.dll, kApiNet.dll,
msvcp120d.dll, msvcr120d.dll, LmiPointClouds.dll 复制 bin 文件夹中;
6) 添加引用 “
Add/Remove References”
7) 从文件夹中添加引用“
Add Reference by typing the name…” and enter the path to
these three files:kApiNet.dl, GoSdkNet.dll, LmiPointClouds.dll
然后点击 “OK”
8) 点击 “
Open” 按钮 加载以下链接 C#脚本:
如果您打算使用 VisionPro 的脚本功能进行自己需要的图像前处理或者后处理,您可以在
我提供的代码上修改
9) “Initialize” 函数, 把 SENSOR_IP 改成你手上的 Gocator 产品的 IP 地址. “127.0.0.1”这
个 IP 是为 Gocator 模拟器提供的.
const string SENSOR_IP = "127.0.0.1"; // Change this to your Gocator's IP address.
10) “PostAcquisitionRefInfo” 函数, 你可以从 Gocator 产品中获取两幅图像(Range 图和灰度
图). 你可以选择你想要的图像.
image = heightMap; // replace this with "intensity" to get intensity data
11) Debug 脚本”Bulid”按钮
Note that currently the Gocator Sdk integration only works when building in “Debug”
mode.
CogJobConfiguration_script.cs
12) 确保 Debug 脚本没有问题
13) 关闭脚本编辑器,点 OK 按钮,确保脚本保存
14) 以上 Gocator 产品高度,亮度信息顺利导入到 VisionPro 中
15) 点击“
Run Job Once” 取像一张, 或者 “
Run Job Continuously” 持续接收图像.
方法 2 - .Net 环境中调用 Gocator SDK 以及 VisionPro Dll
方法一 中脚本 Gocator 函数 已经详细阐述如何通过 Gocator SDK 连接 3D 相机和取像 ,
下步我们要做的就是将 Gocator 获取的高度图以及亮度图转换为 VisionPro ICogImage 图像格
式
在.Net 环境添加 VisionPro dll ,其它函数参照脚本提供的代码
1) 添加 Gocator SDK 引用 .NET projects:
kApiNet.dll,GoSdkNet.dll, kApi.dll, kApiNet.dll,msvcp120d.dll, msvcr120d.dll,
LmiPointClouds.dll 先复制在 debug 文件下后添加引用
2) 参照方法一提供的 C#脚本将 Gocator 获取的高度图以及亮度图转换为 VisionPro
ICogImage 图像格式
通过 Gocator SDK 获取更多信息