Halcon 10.0:Sample 分割边缘拟合圆Circles.hdev
处理流程:快速二值化(区域)->获取区域边缘->截取边缘->膨胀边缘区域(定位)->定位区域进行边缘检测->边缘分割:线和圆->选择属性为圆的弧->拟合圆
*读取图像
read_image (Image, 'double_circle')
dev_close_window ()
get_image_size (Image, Width, Height)
dev_open_window (, , Width, Height, 'black', WindowHandle)
*快速二值化
fast_threshold (Image, Region, , , )
*取region的边界
boundary (Region, RegionBorder, 'inner')
*剪切、膨胀定位弧形区域
clip_region_rel (RegionBorder, RegionClipped, , , , )
dilation_circle (RegionClipped, RegionDilation, 2.5)
reduce_domain (Image, RegionDilation, ImageReduced)
*在弧形区域进行边缘检测
edges_sub_pix (ImageReduced, Edges, 'lanser2', 0.5, , )
*分割边缘:线和圆
segment_contours_xld (Edges, ContoursSplit, 'lines_circles', , , )
count_obj (ContoursSplit, Number)
dev_display (Image)
dev_set_draw ('margin')
dev_set_color ('white')
dev_update_window ('off')
for i := to Number by
*选择轮廓并根据特性确定是否拟合圆:* Attrib = - 线段 椭圆 1圆
select_obj (ContoursSplit, ObjectSelected, i)
get_contour_global_attrib_xld (ObjectSelected, 'cont_approx', Attrib)
if (Attrib > )
*逼近结果生成一个圆轮廓
fit_circle_contour_xld (ObjectSelected, 'ahuber', -, , , , , Row, Column, Radius, StartPhi, EndPhi, PointOrder)
gen_circle_contour_xld (ContCircle, Row, Column, Radius, , rad(), 'positive', 1.0)
dev_display (ContCircle)
endif
endfor
dev_set_colored ()
dev_set_line_width ()
dev_display (ContoursSplit)
Halcon 10.0:Sample 分割边缘拟合圆Circles.hdev的更多相关文章
- Halcon 10.0 Sample:完整性检查(圆形)
* ball.hdev: Inspection of Ball Bonding * 球接合检查 Comment Time:// *核心思想:.白色区域用作自动ROI,黑色区域是目标 * .Openin ...
- Halcon 10.0:Hobject图像转CBitmap
void HImage2CBitmap(Hobject pImage,CBitmap *wImage) { char lpcsType[MAX_STRING]; Hlong lPointer,widt ...
- kafka0.9.0及0.10.0配置属性
问题导读1.borker包含哪些属性?2.Producer包含哪些属性?3.Consumer如何配置?borker(0.9.0及0.10.0)配置Kafka日志本身是由多个日志段组成(log segm ...
- Visual Studio 10.0设置引用HalconDotNet.dll
版权声明:本文为博主原创文章,未经博主同意不得转载. https://blog.csdn.net/u010435562/article/details/8858638 開始做Halcon的上位机.选用 ...
- Kafka: Producer (0.10.0.0)
转自:http://www.cnblogs.com/f1194361820/p/6048429.html 通过前面的架构简述,知道了Producer是用来产生消息记录,并将消息以异步的方式发送给指定的 ...
- IEEEXtreme 10.0 - Inti Sets
这是 meelo 原创的 IEEEXtreme极限编程大赛题解 Xtreme 10.0 - Inti Sets 题目来源 第10届IEEE极限编程大赛 https://www.hackerrank.c ...
- IEEEXtreme 10.0 - Dog Walking
博客中的文章均为 meelo 原创,请务必以链接形式注明 本文地址 Xtreme 10.0 - Dog Walking 题目来源 第10届IEEE极限编程大赛 https://www.hackerra ...
- IEEEXtreme 10.0 - Painter's Dilemma
这是 meelo 原创的 IEEEXtreme极限编程比赛题解 Xtreme 10.0 - Painter's Dilemma 题目来源 第10届IEEE极限编程大赛 https://www.hack ...
- IEEEXtreme 10.0 - Ellipse Art
这是 meelo 原创的 IEEEXtreme极限编程大赛题解 Xtreme 10.0 - Ellipse Art 题目来源 第10届IEEE极限编程大赛 https://www.hackerrank ...
随机推荐
- Thinking in UML-2-建模基础
建模的问题可以分为两个: 怎么建 模是什么 怎么建:角度不同决定了建模方向不同.所以首先要决定抽象的角度即建立这个模型的目的是什么. 模是什么:人+事+物+规则 我们这样来建立模型: 问题领域 = n ...
- mongodb备份与恢复
一.备份:mongodump -d mailaccess -c Mail -q ‘{user:”zhaoxy1@szdep.com”}’ -o /data/dump备份mailaccess datab ...
- [Microsoft][ODBC 驱动程序管理器] 在指定的 DSN 中,驱动程序和应用程序之间的体系结构不匹配
环境: 操作系统:64位WIN7 数据库:SQL Server 2000 SP1 开发语言:J2EE 在Servlet连接数据库时出错提示: [Microsoft][ODBC 驱动程序管理器 ...
- Case1:WorkFlow不能运行的解决办法
原因为CRMAppPool选择了一个域用户,然后异步服务的用户执行会有问题 at CrmException..ctor(Int32 errorCode, Object[] arguments) ilO ...
- php,js清除cookie
目的通过控制cookie中的是否有莫个值实现是否跳转重定向 http方式 <?php if ($_COOKIE['test'] == 1) { echo 'have cookie test'; ...
- 学DIV+CSS技术,如何入门?(2)
http://www.zhangbin.in/a/jishuziliao/CSSjishu/2014/0730/13267_2.html
- HashCode
如果一个类的对象要用做hashMap的key,那么一定要注意覆盖该类的equals和hashCode方法. equals()是基类Object的方法,用于判断对象是否有相同地址及是否为同一对象 pub ...
- [poj2528] Mayor's posters (线段树+离散化)
线段树 + 离散化 Description The citizens of Bytetown, AB, could not stand that the candidates in the mayor ...
- 8-JS闭包、回调实例
1.回调 javascipt中,函数回调一般用于以下几种场景: 1.异步执行(例如读取文件,进行HTTP请求) 2.同步(阻塞) 3.事件监听和处理 4.设置超时和时间间隔的方法 异步例子(使用AJA ...
- Exception&Error
Java异常处理 1:什么是异常 异常(Exception)也叫异常.在Java编程语言中,异常就是程序在运行过程中由于硬件设备问题.软件设计错误.缺陷等导致的程序错误. 1.1:想打开的文件不存在 ...