LabVIEW、Vision、Halcon图像处理编程
NI Vision Builder for Automated Inspection 2020&2023入门教程

目录
版权声明
读者利益
感谢
NI VBAI2020&2023版教程主要修正内容
第一章 NI Vision Builder for Automated Inspection概述
1.1 VBAI简介
1.2 VBAI安装资源获取
1.3 VBAI安装
1.4 VBAI正版许可证
第二章 VBAI欢迎界面
2.1 VBAI欢迎界面布局
2.2 Select a target to run Vision Builder AI选择运行VBAI的目标(仅VBAI2020支持)
2.2.1 Refresh Target List刷新目标列表
2.2.2 Add Target连接设备
2.2.3 Add Simulated Target添加仿真设备
2.3 Config Inspection配置检测
2.4 Run Inspection运行检测
2.4.1 运行检测界面的Inspection检测菜单
2.4.2 运行检测界面的Help帮助菜单
2.5 Getting Start获取开始/Help帮助/Community and Online Support社区和在线支持
第三章 VBAI配置界面
3.1 配置界面菜单
3.1.1 File文件
3.1.2 Edit编辑
3.1.3 View查看
3.1.4 Operate操作
3.1.5 Tools工具
3.1.6 Help帮助
3.2 配置界面快捷按钮
3.3 VBAI主窗口
3.4 VBAI次窗口
3.5 VBAI图像信息栏
3.6 State状态栏
3.6.1 状态名称栏
3.6.2 步骤控制快捷按钮
3.6.3 为此状态显示结果图像
3.6.4 状态的具体检测步骤
3.6.5 检测状态结果状态
3.7 功能与函数
3.7.1 Acquire Images采集图像
3.7.2 Enhance Images增强图像
3.7.3 Locate Features定位特征
3.7.4 Measure Features测量特征
3.7.5 Check for Presence存在检查
3.7.6 Indentify Parts识别零件
3.7.8 Communicate通信
3.7.9 Use Additional Tools使用附加工具
第四章 Acquire Images采集图像
4.1 Acquire Image采集图像
4.1.1 Main主体
4.1.2 Image Trigger图像触发
4.1.3 Calibration标定
4.2 Acquire Image(1394, GigE, or USB)采集图像(1394,GigE,或USB)
4.2.1 Main主体
4.2.2 Common通用
4.2.3 Attibutes属性
4.2.4 Calibration标定
4.2.5 Acquire Image could not be initialized采集图像不能初始化
4.2.6 TimeOut超时
4.3 Read/Write Camera Attributes读/写相机属性
4.3.1 Main主体
4.3.2 Attributes属性
4.4 Read Image File读取图像文件
4.4.1 Main主体
4.4.2 Calibration标定
4.5 Select Image选择图像
4.5.1 Main主体
第五章 Enhance Images增强图像
5.1 Flat Field Correction平场校正
5.1.1 Flat Field Correction平场校正前置图像
5.1.2 Flat Field Correction Setup-使用模型在线校正
5.1.3 Flat Field Creation Wizard平场创建向导
5.1.4 Flat Field Correction Setup-用指定亮场图像进行校正
5.1.5 Update Flat Field Resource更新平场资源
5.1.6 平场校正综合实例
5.2 Vision Assistant视觉助手简介
5.3 Filter Image滤波图像
5.3.1 Main主体
5.3.2 Filters滤波器
5.4 Threshold Image阈值图像
5.4.1 灰度图像阈值
5.4.2 彩色图像阈值
5.5 Segment Color Image分割彩色图像
5.5.1 Main主体
5.5.2 Color Classification Training Interface颜色分类训练接口程序
5.5.3 Settings设置
5.5.4 Pixel Mapping像素映射
5.5.5 Limits范围
5.5.6 颜色分割实例
5.6 Calibrate Image标定图像
5.6.1 Main主体
5.6.2 Calibaration Data标定数据
5.7 Create Region of Interest创建兴趣区域
5.7.1 Main主体
5.7.2 Coordinates坐标
5.7.3 Limits范围
第六章 VBAI中的Vision Assisntat视觉助手
6.1 Main主体
6.2 VBAI视觉助手界面布局菜单介绍
6.2.1 VBAI视觉助手布局
6.2.2 File文件菜单
6.2.3 Edit编辑菜单
6.2.4 Image图像菜单
6.2.5 Color颜色菜单
6.2.6 Grayscale灰度菜单
6.2.7 Binray二值菜单
6.2.8 View查看菜单
6.2.9 Tools工具菜单
6.2.10 Help帮助菜单
6.3 Processing Functions: Image处理函数:图像
6.3.1 Get Image获取图像
6.3.2 Histogram直方图
6.3.3 Line Profile线剖面图
6.3.4 Measure测量
6.3.5 3D View三维视图
6.3.6 Brightness亮度
6.3.7 Image Mask图像掩模
6.3.8 Geometry几何
6.3.9 Image Buffer图像缓存
6.3.10 Set Bit Depth设置位深
6.4 Processing Functions: Color处理函数:颜色
6.4.1 Color Operators颜色算子
6.4.2 Extract Color Planes提取颜色平面
6.4.3 Color Threshold颜色阈值
6.5 Processing Functions Grayscale处理函数:灰度
6.5.1 Lookup Table查找表
6.5.2 Filters滤波器
6.5.3 Gray Morphology灰度形态学
6.5.4 Gray Morphology Reconstruction灰度形态学重建
6.5.5 FFT Filter快速傅立叶变换滤波器
6.5.6 Threshold阈值
6.5.7 Watershed Segmentation分水岭分割
6.5.8 Operators算子
6.5.9 Conversion转换
6.5.10 Set Bit Depth设置位深
6.5.11 Extract FFT Plane提取快速傅立叶变换平面
6.6 Processing Functions Binary处理函数:二值
6.6.1 Basic Morphology基础形态学
6.6.2 Adv.Morphology高级形态学
6.6.3 Particle Filter粒子滤波器
6.6.4 Invert Binary Image反转二值图像
6.6.5 Binary Morphological Reconstruction二值形态学重建
第七章 Locate Features定位特征
7.1 Find Edges查找边缘
7.1.1 Main主体
7.1.2 Settings设置
7.1.3 Advanced高级
7.1.4 Limits范围
7.1.5 Set Inspection Status设置检测状态
7.2 Find Straight Edge查找直边
7.2.1 Main主体
7.2.2 Settings设置
7.2.3 Advanced高级
7.2.4 Limits范围
7.3 Adv. Straight Edge高级直边
7.3.1 Main主体
7.3.2 Edge Detectror Settings边缘检测器设置
7.3.3 Straight Edge Settings直边设置
7.3.4 Limits范围
7.4 Find Circular Edge查找圆边
7.4.1 Main主体
7.4.2 Settings设置
7.4.3 Advanced高级
7.4.4 Limits范围
7.5 Match Pattern匹配模式
7.5.1 Main主体
7.5.2 Specifications规格
7.5.3 Options选项
7.5.4 Limits范围
7.6 Set Coordinate System设置坐标系
7.6.1 Main主体
7.6.2 Limits范围
7.7 Detect Objects检测目标
7.7.1 Main主体
7.7.2 Threshold阈值
7.7.3 Settings设置
7.7.4 Filter滤波器
7.7.5 Limits范围
7.8 Map Defects映射缺陷
7.8.1 Main主体
7.8.2 Specifications规格
7.8.3 Options选项
7.8.4 Defects缺陷
7.8.5 Limits范围
7.9 Track Object跟踪目标
7.9.1 Main主体
7.9.2 Settings设置
7.9.3 Limits范围
7.10 Match Color Pattern匹配颜色模式
7.10.1 Main主体
7.10.2 Template模板
7.10.3 Settings设置
7.10.4 Limits范围
第八章 Measure Features测量特征
8.1 Measure Intensity测量强度
8.1.1 Main主体
8.1.2 Histogram直方图
8.1.3 Limits范围
8.2 Measure Colors测量颜色
8.2.1 Main主体
8.2.2 Histogram直方图
8.2.3 Limits范围
8.3 Count Pixels计数像素
8.3.1 Main主体
8.3.2 Settings设置
8.3.3 Limits范围
8.4 Max Caliper最大卡尺
8.4.1 Main主体
8.4.2 Settings设置
8.4.3 Limits范围
8.5 Caliper卡尺
8.5.1 Main主体
8.5.2 Settings设置
8.5.3 Limits范围
8.6 Geometry几何
8.6.1 几何函数参数介绍
8.6.2 Distance距离
8.6.3 Distance Projection距离投影
8.6.4 Mid Point Distance中点距离
8.6.5 X Distance Between Lines at Y 在Y处直线之间的距离
8.6.7 Y Distance Between Lines at X 在X处直线之间的距离
8.6.8 Mid Point中点
8.6.9 Perpendicular Projection垂直投影
8.6.10 Lines Intersection直线交点
8.6.11 Bisecting Line角平分线
8.6.12 Mid Line中线
8.6.13 Angle from Horizontal水平夹角
8.6.14 Angle from Vertical垂直夹角
8.6.15 Angle Defined by 3 Points由3点定义的角度
8.6.16 Angle Defined by 4 Points由4点定义的角度
8.6.17 Center of Mass质心
8.6.18 Area面积
8.6.19 Line and Circle Intersection直线和圆交点
8.6.20 Circles Intersection圆交点
8.6.21 Circle Tangent Lines to Point圆切线到点
8.6.22 Line Fit线拟合
8.6.23 Circle Fit圆拟合
8.6.24 Ellipse Fit椭圆拟合
8.6.25 Circumscribed Circle外接圆
8.6.26 Inscribed Circle内切圆
第九章 Check for Presence存在检查
9.1 Detect Objects检测目标
9.2 Measure Intensity测量强度
9.3 Count Pixels计数像素
9.4 Map Defects映射缺陷
9.5 Match Colors匹配颜色
9.5.1 Main主体
9.5.2 Template模板
9.5.3 Settings设置
9.5.4 Limits范围
9.6 Find Edges查找边缘
9.7 Inspect Contours检测轮廓
9.7.1 Main主体
9.7.2 Extract Contour提取轮廓
9.7.3 Compare Contours比较轮廓
9.7.4 Limits范围
9.8 Detect Defects检测缺陷
9.8.1 Main主体
9.8.2 Alignment对齐
9.8.3 Settings设置
9.8.4 Filter滤波器
9.8.5 Limits范围
9.9 Match Pattern匹配模式
9.10 Match Color Pattern匹配颜色模式
9.11 Detect Texture Defects检测纹理缺陷
9.11.1 Main主体
9.11.2 NI Texture Training Interface纹理训练接口程序
9.11.3 Segmentation分割
9.11.4 Filter滤波器
9.11.5 Limits范围
第十章 Identify Parts识别零件
10.1 Read/Verify Text读取/验证文本
10.1.1 Main主体
10.1.2 Mode模式
10.1.3 NI OCR Training Interface光学字符识别训练接口程序
10.1.4 Threshold阈值
10.1.5 Size大小
10.1.6 Options选项
10.1.7 Limits范围
10.2 Classify Objects分类目标
10.2.1 Main主体
10.2.2 NI Particle Classification Training Interface粒子分类训练接口程序
10.2.3 Threshold阈值
10.2.4 Options选项
10.2.5 Classify分类
10.2.6 Limits范围
10.3 Classify Colors分类颜色
10.3.1 Main主体
10.3.2 NI Color Classification Training Interface颜色分类训练接口程序
10.3.3 Classify分类
10.3.4 Limits范围
10.4 Read 1D Barcode读取一维条码
10.4.1 Main主体
10.4.2 Settings设置
10.4.3 Results结果
10.4.4 Limits范围
10.5 Read 2D Barcode读取二维条码
10.5.1 Main主体
10.5.2 Settings设置
10.5.3 Grading分级(Data Matrix专用)
10.5.4 Limits范围
第十一章 Communicate通信
11.1 Read/Write I/O (Vision RIO)读/写输入/输出(不介绍)
11.2 Generate Pulse (Vision RIO)生成脉冲(不介绍)
11.3 Read/Write I/O读/写输入/输出(不介绍)
11.4 Generate Pulse生成脉冲(不介绍)
11.5 Read/Write I/O(NI-DAQmx)读/写输入/输出(不介绍)
11.6 Serial I/O串行输入/输出
11.6.1 Configuration配置界面
11.6.2 串行I/O设备实例
11.6.3 串口设置
11.7 TCP I/O传输控制协议输入/输出(不介绍)
11.8 Modbus Slave Modbus从机(不介绍)
11.9 Ethernet/IP以太网/互联网协议(不介绍)
11.10 Ethernet/IP Adapter以太网/互联网协议适配器(不介绍)
11.11 OPC UA开放性生产控制和统一架构(不介绍)
第十二章 Use Additional Tools使用附加工具
12.1 Set Inspection status设置检测状态
12.2 Calculator计算器
12.2.1 Main主体
12.2.2 Measuments测量
12.2.3 Limit范围
12.3 Logic Calculator逻辑计算器
12.4 Set Variable设置变量
12.5 Array Operator数组算子
12.6 Run LabVIEW VI运行LabVIEW VI
12.7 Custom Overlay自定义覆盖
12.7.1 Main主体
12.7.2 Custom Overlay自定义覆盖
12.7.3 Layer Management图层管理
12.8 Display Image显示图像
12.9 Delay延迟
12.10 Data Logging数据记录
12.10.1 Measurements Logged记录的测量
12.10.2 Data Formatting数据格式
12.10.3 Destination目标
12.11 Image Logging图像记录
12.11.1 Log to Local Drive记录到本地驱动器
12.11.2 Log to FTP Server记录到FTP服务器
12.12 Read/Write Variables to INI File读/写变量到配置文件
12.13 User Input用户输入
12.14 Update Inspection UI更新检测界面
12.15 Select Inspection选择检测
12.15.1 选择检测的使用范围与方法
12.15.2 Inspection Path Value检测路径值
12.15.3 Inspection Table Value检测表值
第十三章 State Diagram状态图
13.1 Inspection Setup检测设置
13.2 Inspection Cleanup检测清除
13.3 Select Inspection选择检测
13.4 Inspection State Diagram检测状态图
13.4.1 Creating New States创建新状态
13.4.2 Creating Transitions Between States创建状态之间的转换
13.4.3 Modifying Transition Priorities修改转换属性
13.4.4 Modifying State Diagram Objects修改状态图目标
13.4.5 Deleting State Diagram Objects删除状态图目标
13.4.6 检测状态图对齐
13.4.7 检测状态图编辑
13.4.8 检测状态图实例
第十四章 LabVIEW调用VBAI脚本
14.1 LabVIEW中VBAI API函数介绍
14.1.1 VBAI Interface - Open Connection打开连接
14.1.2 VBAI Interface - Close Connection关闭连接
14.1.3 VBAI Interface - Launch Local VBAI Engine启动本地引擎
14.1.4 VBAI Interface - Close Local VBAI Engine关闭本地引擎
14.1.5 VBAI Interface - Get VBAI Engine Status获取引擎状态
14.1.6 VBAI Interface - Enumerate VBAI Engines枚举引擎
14.1.7 VBAI Interface - Get Target Inspections获取目标检测
14.1.8 VBAI Interface - Open Inspection打开检测
14.1.9 VBAI Interface - Get Inspection Info获取检测信息
14.1.10 VBAI Interface - Get Inspection Steps获取检测步骤
14.1.11 VBAI Interface - Get Inspection State Diagram获取检测状态图
14.1.12 VBAI Interface - Target Date & Time目标日期时间
14.1.13 VBAI Interface - Run Inspection Once运行检测一次
14.1.14 VBAI Interface - Start Inspection开始检测
14.1.15 VBAI Interface - Stop Inspection停止检测
14.1.16 VBAI Interface - Get Inspection Image (Polymorphic)获取检测图像(多态)
14.1.17 VBAI Interface - Get Inspection Results获取检测结果
14.1.18 VBAI Interface - Enable Inspection Measurements启用检测测量
14.1.19 VBAI Interface - Get Inspection Measurements (Polymorphic)获取检测测量(多态)
14.1.20 VBAI Interface - Reset Inspection Statistics重置检测统计
14.1.21 VBAI Interface - Get Inspection Statistics获取检测统计
14.1.22 VBAI Interface - Set Variable设置变量
14.2 LabVIEW通过VBAI API调用VBAI脚本例子
14.2.1 官方对话框打开脚本示例
14.2.2 打开VBAI脚本序列
14.2.3 调用VBAI状态机示例
第十五章 自定义步骤
15.1 Import Vision Builder AI Step导入VBAI步骤
15.2 Create Custom Step创建自定义步骤
15.2.1 创建自定义步骤向导
15.2.2 创建自定义步骤Manual Threshould官方示例
15.2.3 创建Straight Edge Caliper直边卡尺自定义步骤
15.3 Test Your Custom Step in Vision Builder Al在VBAI中测试自定义步骤
15.4 Save Your Custom Step for Distribution保存自定义步骤以便分发
第十六章 VBAI检测脚本实例
16.1 多条码识别
16.2 钢管槽方向判断
16.3 医疗布标签方向与类别检测
16.4 塑料产品水口长度检测
16.5 瓶盖有无拧紧检测
16.6 塑料载物盒(料盘)计数
16.7 镀膜玻璃正反判断
16.8 螺丝有无螺牙检测
16.9 手机指示灯颜色识别
16.10 鼓簧有无与变形检测
16.11 喇叭同心度检测
16.12 塑料件有无喷银粉检测
16.13 钢柱表面缺陷检测
16.14 五金零件正反方向判断
16.15 Mark点定位
16.16 五金圆管变形毛刺检测