项目介绍
检测流程 1、首先ROI感性区域提取降低计算量,提高效率 2、定位焊锡脚位置(在机械定位后,需要软件进行精确定位) 3、对焊锡脚所在区域进行区域划分(平移和旋转色标卡) 4、判断色标卡不同区域内是否包含焊锡
5、检测环境必须是黑箱环境(光照需要特别弱)
代码
* Image Acquisition 01: Code generated by Image Acquisition 01open_framegrabber ('DirectShow', 1, 1, 0, 0, 0, 0, 'default', 8, 'rgb', -1, 'false', 'default', '[1] ', 0, -1, AcqHandle)grab_image_start (AcqHandle, -1)while (true)grab_image_async (Image, AcqHandle, -1)decompose3 (Image, r, g, b)trans_from_rgb (r, g, b, h, s, v, 'hsv') threshold (s, Regions, 63, 253)reduce_domain (s, Regions, ImageReduced)threshold (v, Regions1, 118, 173)reduce_domain (ImageReduced, Regions1, ImageReduced2)connection (ImageReduced2, ConnectedRegions)select_shape (ConnectedRegions, SelectedRegions, 'row', 'and', 100, 500)select_shape (SelectedRegions, SelectedRegions1, 'column', 'and',200, 400)select_shape (SelectedRegions1, SelectedRegions2, 'area', 'and', 300, 1900)orientation_region (SelectedRegions2, Phi)area_center (SelectedRegions2, Area, Row, Column)if(Area>10)vector_angle_to_rigid (Row, Column, Phi, Row, Column, rad(180), HomMat2D)affine_trans_region (SelectedRegions2, RegionAffineTrans, HomMat2D, 'nearest_neighbor')dilation_rectangle1 (RegionAffineTrans, RegionDilation, 7,3 )dev_clear_window ()dev_display (RegionDilation)endifwait_seconds (3)* dev_disp_text (Phi, 'window', Row, Column, 'black', [], [])* stop ()* Image Acquisition 01: Do somethingendwhileclose_framegrabber (AcqHandle)
演示结果:
源图片:
识别分析后效果:
【基于Halcon的焊锡脚挂锡识别项目】完整代码下载地址
- Linux中PS1
- 6 bash ps1变量_shell基础PS1环境变量的作用和使用方法
- Excel中怎么把混乱的数据分列?
- 关于2006绝对唱响的介绍 2006绝对唱响
- 关于ilegenes黑耀的轨迹的介绍 ilegenes黑耀的轨迹
- C#OCR图片识别
- ——对小车最佳路径计算算法的ray部署和测试
- ?LeetCode刷题实战372:超级次方
- 安利研究生必用的科研软件
- [Unity实践笔记] 整页翻、防误触的ScrollView