当前位置:网站首页>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)边栏推荐
猜你喜欢

【CV-Learning】线性分类器(SVM基础)

Data reading in yolov3 (1)

(十六)图的基本操作---两种遍历

Logistic Regression --- Introduction, API Introduction, Case: Cancer Classification Prediction, Classification Evaluation, and ROC Curve and AUC Metrics

BatchNorm&&LayerNorm

0, deep learning 21 days learning challenge 】 【 set up learning environment

两个APP进行AIDL通信

【CV-Learning】卷积神经网络

彻底搞懂箱形图分析

Kubernetes集群安装
随机推荐
Matplotlib中的fill_between;np.argsort()函数
逻辑回归---简介、API简介、案例:癌症分类预测、分类评估法以及ROC曲线和AUC指标
postgres recursive query
TensorFlow2学习笔记:4、第一个神经网模型,鸢尾花分类
postgresql 游标(cursor)的使用
Various commands such as creating a new user in postgresql
sklearn中的学习曲线learning_curve函数
flink-sql所有表格式format
flink on yarn任务迁移
Use of double pointers
SQL的性能分析、优化
Androd Day02
The use of the attribute of the use of the animation and ButterKnife
剑指 Offer 2022/7/3
【CV-Learning】Object Detection & Instance Segmentation
【CV-Learning】目标检测&实例分割
TensorFlow2 study notes: 5. Common activation functions
MySQL事务详解(事务隔离级别、实现、MVCC、幻读问题)
动手学深度学习__张量
oracle临时表与pg临时表的区别