当前位置:网站首页>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中实现。
这里我是在手动选择图片中加入的代码,大家可以直接复制到对应的相机回调函数中即可。
我们之前写了一个检测方法,下一篇我们把检测方法再放进来。。。。。。。。
边栏推荐
- Code implementation of hash table based on linear detection
- C # getting started series (12) -- string
- Strange error -- frame detected by contour detection, expansion corrosion, and reversal of opening and closing operation effect
- 链式哈希表
- Transport layer protocol -- TCP protocol
- 日本经济泡沫与房价泡沫
- string类对象的访问及遍历操作
- 003:AWS认为什么是数据湖?
- Create simple windowing programs using Visual Studio 2017
- How to do industry analysis
猜你喜欢

《真北》读书笔记

链式哈希表

Chained hash table

【云原生 | Kubernetes篇】Kubernetes 网络策略(NetworkPolicy)

榜样访谈——董宇航:在俱乐部中收获爱情

How CEPH improves storage performance and storage stability
![[preview of the open class of Jishu] arm's strongest MCU core cortex-m85 processor helps the innovation of the Internet of things in an all-round way (there is a lottery)](/img/25/c3af3f51c04865820e3bbe2f010098.png)
[preview of the open class of Jishu] arm's strongest MCU core cortex-m85 processor helps the innovation of the Internet of things in an all-round way (there is a lottery)

Combat tactics based on CEPH object storage

Research progress of DNA digital information storage

Autojs learning notes 6:text (txt) Findone() will report an error when switching apps. Finally, solve the implementation effect and switch any app until the script finds the control with the specified
随机推荐
Value investment
June training (day 12) - linked list
端午节安康--诸佬在我心里越来越粽要了
Implementation of hotspot synchronized
IV Transforming regular expressions into finite state automata: DFA minimization
日本经济泡沫与房价泡沫
Strange error -- frame detected by contour detection, expansion corrosion, and reversal of opening and closing operation effect
True north reading notes
Auto.js学习笔记8:常用且重要的一些API
JVM garbage collection
传输层协议 ——— TCP协议
UE4_ Explore the method of creating background scenes with ready-made resources
003:AWS认为什么是数据湖?
7-5 哲哲打游戏
Enumerate all USB device codes
价值投资.
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
Mysql5.7 partition table
Implementation of hotspot reference
II Transforming regular expressions into finite state automata: NFA state machine recognizes input strings