一、HALCON学习笔记(容器液位缺陷检测)

本文是关于HALCON在容器液位缺陷检测的应用笔记。通过初始化测量句柄、转换度量对象和提取直线边缘等步骤,捕获图像中垂直于矩形的直线,以判断液位是否越界,实现缺陷检测。
摘要由CSDN通过智能技术生成

一、HALCON学习笔记(容器液位缺陷检测)

* In this example a fill level check for the
* pharmaceutical industry is demonstrated. The task is
* to check for the fill level of each single nose drop ampoule.
* To do so, we first locate each ampoule head by applying
* shape-based matching, then we find the fill level
* by measuring the gray level change using a 1D Measuring.
* 
* 1 绘图设置
dev_close_window ()
dev_update_off ()
read_image (Image, 'ampoules/ampoules_01')
get_image_size (Image, Width, Height)
dev_open_window_fit_image (Image, 0, 0, -1, -1, WindowHandle)
dev_set_line_width (2)
dev_set_draw ('margin')
set_display_font (WindowHandle, 16, 'mono', 'true', 'false')
* 
* Create a model for the ampoule head to align the measure handle
* 2 创建形状模板
gen_rectangle1 (Rectangle, 230, 280, 317, 330)
reduce_domain (Image, Rectangle, ImageModel)
create_shape_model (ImageModel, 'auto', 0, 0, 'auto', 'auto', 'use_polarity'
  • 0
    点赞
  • 4
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值