当前位置:网站首页>Halcon缺陷检测
Halcon缺陷检测
2022-08-04 05:29:00 【视觉菜鸟Leonardo】
1.检测圆的最大轮廓:
(1)滤波
(2)Canny边缘分割
(3)提取轮廓
(4)按要求筛选出线段和圆弧
(5)找出最长的圆弧轮廓
(6)拟合圆,连接轮廓
(7)求得半径和坐标
*平滑
median_image(Image,ImageMedian,'square', 5, 'mirrored')
*canny边缘
edges_sub_pix(Image,edges,'canny',1,20,40)
*第一次挑选出长的轮廓,有效滤除假边缘
select_shape_xld(edges,select_edges,'area','or',2000,9999999)
*将XLD轮廓分割为直线段、圆(圆弧)、椭圆弧。
segment_contours_xld (select_edges, ContoursSplit, 'lines_circles', 5, 4, 3)
*根据轮廓点面积挑选出长的圆形轮廓
select_shape_xld(ContoursSplit,select_edges2,'area','or',4000,999999)
*根据圆度挑选轮廓
select_shape_xld(select_edges2,select_edges3,'circularity','or',0,0.15)
count_obj (select_edges3, Number)
*连接轮廓
union_cocircular_contours_xld (select_edges3, CircleContours, rad(45), rad(0), rad(45), 300, 50, 50, 'true', 10)
*利用连接的轮廓拟合圆
fit_circle_contour_xld (CircleContours, 'algebraic', -1, 0, 0, 3, 2, Row, Column, Radius, StartPhi, EndPhi, PointOrder)
*拟合圆的坐标、半径
gen_contour_polygon_xld (Contour, Row, Column)
如果拟合出来的圆有两段或者多段,可以去半径和坐标相对应的数组中的最大值或者平均值,如图
tuple_max(Row, roMax)
tuple_max(Column,coMax)
tuple_max(Radius,raMax)
*选取最大值矩阵
gen_circle_contour_xld(ContCircle,roMax,coMax,raMax, 0, 6.28318, 'positive', 1)
gen_circle(ContCircle,Row, Column, Radius)
reduce_domain(Image,ContCircle,ImageReduced)
边栏推荐
- Linear Regression 02---Boston Housing Price Prediction
- 动手学深度学习_softmax回归
- sklearn中的pipeline机制
- oracle临时表与pg临时表的区别
- [Deep Learning 21 Days Learning Challenge] 2. Complex sample classification and recognition - convolutional neural network (CNN) clothing image classification
- Androd Day02
- (十)树的基础部分(一)
- Data reading in yolov3 (1)
- MySQL事务详解(事务隔离级别、实现、MVCC、幻读问题)
- 字典特征提取,文本特征提取。
猜你喜欢
【深度学习21天学习挑战赛】3、使用自制数据集——卷积神经网络(CNN)天气识别
[Deep Learning 21 Days Learning Challenge] 1. My handwriting was successfully recognized by the model - CNN implements mnist handwritten digit recognition model study notes
MySQL事务详解(事务隔离级别、实现、MVCC、幻读问题)
(九)哈希表
CAS与自旋锁、ABA问题
flink sql left join数据倾斜问题解决
线性回归简介01---API使用案例
(十)树的基础部分(二)
(十一)树--堆排序
[Introduction to go language] 12. Pointer
随机推荐
(十)树的基础部分(一)
pgsql函数中的return类型
TensorFlow2学习笔记:6、过拟合和欠拟合,及其缓解方案
Install dlib step pit record, error: WARNING: pip is configured with locations that require TLS/SSL
[CV-Learning] Semantic Segmentation
动手学深度学习__数据操作
动手学深度学习_卷积神经网络CNN
[CV-Learning] Convolutional Neural Network Preliminary Knowledge
npm install dependency error npm ERR! code ENOTFOUNDnpm ERR! syscall getaddrinfonpm ERR! errno ENOTFOUND
flink-sql所有数据类型
双重指针的使用
线性回归02---波士顿房价预测
(TensorFlow) - detailed explanation of tf.variable_scope and tf.name_scope
MySQL最左前缀原则【我看懂了hh】
flink-sql查询配置与性能优化参数详解
flink-sql所有表连接器
ValueError: Expected 96 from C header, got 88 from PyObject
SQL的性能分析、优化
剑指 Offer 2022/7/1
(TensorFlow)——tf.variable_scope和tf.name_scope详解