当前位置:网站首页>HALCON联合C#检测表面缺陷——仿射变换(三)
HALCON联合C#检测表面缺陷——仿射变换(三)
2022-06-12 09:55:00 【必须奔跑的Zheng】
这个系列的专栏不是直接给代码的,这点我需要声明一下,主要是提供搭建视觉检测软件的思路,告诉大家如何编程,如何实现检测,文章中涉及的代码不是唯一的,只是示例,大家可以举一反三。
上一篇讨论了旋转矩阵,这一篇我们在旋转矩阵的基础上添加偏移矩阵。
但是这样一步一的使用矩阵是有点麻烦的,所以今天介绍一个能够同时完成旋转和偏移的函数

Row1,Column1,Angle1是初始坐标和角度
Row2,Column2,Angle2是需要旋转到的坐标和角度
所以修改代码如下

运行测试
检测区域随着模板的位置和角度发生了变化
做到这里我们再来做检测就很简单了,只要处理检测区域的内容就可以了,
我们再来看下检测流程
1.相机取图
2.模板匹配
3.旋转检测区域
4.调用算法检测区域内的脏污或者测量尺寸
5.输出NG或者OK
6.采用通信或者IO输出结果和数据
7.更新报表
7.控制运动系统动作等
上面的流程是我们都可以再winform中实现。
这里我是在手动选择图片中加入的代码,大家可以直接复制到对应的相机回调函数中即可。
我们之前写了一个检测方法,下一篇我们把检测方法再放进来。。。。。。。。
边栏推荐
- SAP HANA 错误消息 SYS_XSA authentication failed SQLSTATE - 28000
- 【系统分析师之路】第十八章 复盘系统安全分析与设计
- 003:what does AWS think is a data lake?
- Using C language code to realize factory LCD RGB test program
- II Transforming regular expressions into finite state automata: NFA state machine recognizes input strings
- 存储研发工程师招聘
- Auto.js学习笔记5:autojs的UI界面基础篇1
- 在线电路仿真以及开源电子硬件设计介绍
- 2022 极术通讯-安谋科技纷争尘埃落定,本土半导体产业基石更稳
- Auto.js学习笔记9:脚本引擎使用,启动指定路径脚本文件和关闭等基础方法
猜你喜欢

行业分析怎么做

004:AWS数据湖解决方案

In 2026, the capacity of China's software defined storage market will be close to US $4.51 billion

Auto. JS debugging: use the network mode of lightning simulator for debugging

Theoretical explanation of hash table

电阻的作用有哪些?(超全)

005:数据湖与数据仓库的区别

Differences among list, set and map

科创人·世界500强集团CIO李洋:数字化转型成事在人,决策者应时刻聚焦于「柴」

001:数据湖是什么?
随机推荐
SAP Hana error message sys_ XSA authentication failed SQLSTATE - 28000
Jetpack架构组件学习(3)——Activity Results API使用
There is always a negative line (upper shadow line) that will stop the advance of many armies, and there is always a positive line (lower shadow line) that will stop the rampant bombing of the air for
Explanation of the principle of MySQL's leftmost matching principle
在线电路仿真以及开源电子硬件设计介绍
一文读懂Dfinity生态中的首个NFT平台:IMPOSSIBLE THINGS
Implementation of hotspot synchronized
Difference between MySQL unreal reading and non repeatable reading
Storage R & D Engineer Recruitment
I Regular expression to finite state automata: regular expression to NFA
Example interview -- dongyuhang: harvest love in the club
Implementation of hotspot reference
MySQL优化之慢日志查询
005:数据湖与数据仓库的区别
MYSQL的最左匹配原则的原理讲解
《要领》读书笔记
IV Transforming regular expressions into finite state automata: DFA minimization
Autojs学习笔记6:text(txt).findOne()切换app时会报错,最后解决实现效果,切换任何app直到脚本找到指定的txt文字的控件进行点击。
端午節安康--諸佬在我心裏越來越粽要了
Auto. JS learning notes 7: JS file calls functions and variables in another JS file to solve various problems of call failure