Halcon算子–图像、区域、轮廓、测量、拟合、垂足、夹角

read_image (Image,‘fabrik’)

画矩形

draw_rectangle1 (3600, Row1, Column1, Row2, Column2)

gen_rectangle1 (Rectangle, Row1, Column1, Row2, Column2)

缩减图像定义域

reduce_domain (Image, Rectangle, ImageReduced)

阈值分割出感兴趣的部分

threshold (ImageReduced, Region, 0, 65)

将不相互连接的区域分开为单独区域

connection (Region, ConnectedRegions)

根据区域面积筛选出指定区域

select_shape (ConnectedRegions, SelectedRegions, ‘area’, ‘and’, 2500, 5150)

测量算子

画仿射矩形

draw_rectangle2 (3600, Row5, Column4, Phi1, Length1, Length2)

gen_rectangle2 (Rectangle1, Row5, Column4, Phi1, Length1, Length2)

获取测量句柄

gen_measure_rectangle2 (Row5, Column4, Phi1, Length1, Length2, 512, 512, ‘nearest_neighbor’, MeasureHandle)

句柄,平滑参数,灰度差,极性,选择边缘点,边缘中心y,x坐标,幅度,距离

measure_pos (Image, MeasureHandle, 6.1, 65, ‘all’, ‘all’, RowEdge, ColumnEdge, Amplitude, Distance)

gen_cross_contour_xld (Cross, RowEdge, ColumnEdge, 6, Phi1)

close_measure (MeasureHandle)

图像–区域–轮廓

区域转轮廓

gen_contour_region_xld (SelectedRegions, Contours, ‘border’)

轮廓点坐标

get_contour_xld (Contours, Row, Col)

gen_cross_contour_xld (Cross1, Row, Col, 6, Phi1)

轮廓拟合圆

fit_circle_contour_xld (Contours, ‘algebraic’, -1, 0, 0, 3, 2, Row3, Column, Radius, StartPhi, EndPhi, PointOrder)

gen_circle_contour_xld (ContCircle, Row3, Column, Radius, 0, 6.28318, ‘positive’, 1)

轮廓拟合椭圆或椭圆弧

fit_ellipse_contour_xld (Contours, ‘fitzgibbon’, -1, 0, 0, 200, 3, 2, Row4, Column3, Phi, Radius1, Radius2, StartPhi1, EndPhi1, PointOrder1)

gen_ellipse_contour_xld (ContEllipse, Row4, Column3, Phi, Radius1, Radius2, 0, 6.28318, ‘positive’, 1.5)

图像–轮廓

提取亚像素精度边缘轮廓

edges_sub_pix (ImageReduced, Edges, ‘canny’, 1, 20, 40)

筛选出指定轮廓

select_contours_xld (Edges, SelectedContours, ‘contour_length’, 0, 50, -0.5, 0.5)

dev_set_color (‘green’)

拟合直线

fit_line_contour_xld (SelectedContours, ‘tukey’, -1, 0, 5, 2, RowBegin, ColBegin, RowEnd, ColEnd, Nr, Nc, Dist)

disp_line (3600, RowBegin, ColBegin, RowEnd, ColEnd)

拟合矩形

生成感兴趣的区域*

read_image (Image, ‘fabrik’)

draw_rectangle1 (3600, Row11, Column11, Row2, Column2)

gen_rectangle1 (Rectangle, Row11, Column11, Row2, Column2)

reduce_domain (Image, Rectangle, ImageReduced)

提取轮廓,拟合矩形

edges_sub_pix (ImageReduced, Edges, ‘canny’, 1, 20, 40)

select_contours_xld (Edges, SelectedContours, ‘contour_length’, 80, 800, -0.5, 0.5)

fit_rectangle2_contour_xld (SelectedContours, ‘regression’, -1, 0, 0, 3, 2, Row1, Column1, Phi1, Length11, Length21, PointOrder)

gen_rectangle2 (Rectangle1, Row1, Column1, Phi1, Length11, Length21)

计算垂足、夹角

read_image (Image, ‘fabrik’)

draw_rectangle1 (3600, Row1, Column1, Row2, Column2)

gen_rectangle1 (Rectangle, Row1, Column1, Row2, Column2)

reduce_domain (Image, Rectangle, ImageReduced)

edges_sub_pix (ImageReduced, Edges, ‘canny’, 1, 20, 40)

sort_contours_xld (Edges, SortedContours, ‘upper_left’, ‘true’, ‘row’)

取轮廓上的点

select_obj (SortedContours, ObjectSelected, 2)

get_contour_xld (ObjectSelected, Row, Col)

取轮廓上的线

select_obj (SortedContours, ObjectSelected1, 10)

fit_line_contour_xld (ObjectSelected1, ‘tukey’, -1, 0, 5, 2, RowBegin, ColBegin, RowEnd, ColEnd, Nr, Nc, Dist)

计算点到线的垂足

projection_pl (Row[0],Col[0],RowBegin, ColBegin, RowEnd, ColEnd ,RowProj, ColProj)

显示点、直线、垂足、垂线

gen_cross_contour_xld (Cross,Row[0],Col[0], 6, 0.785398)

disp_line (3600, RowBegin, ColBegin, RowEnd, ColEnd)

gen_cross_contour_xld (Cross1,RowProj, ColProj, 6, 0.785398)

disp_line (3600, Row[0],Col[0],RowProj, ColProj)

计算两条直线的夹角

angle_ll ( RowBegin, ColBegin, RowEnd, ColEnd, Row[0],Col[0],RowProj, ColProj, Angle)

弧度转角度deg,角度转弧度rad

Ang:=deg(Angle)

计算直线和水平轴x的夹角

angle_lx (RowBegin, ColBegin, RowEnd, ColEnd, Angle1)

Ang1:=deg(Angle1)

angle_lx (Row[0],Col[0],RowProj, ColProj, Angle2)

Ang2:=deg(Angle2)

Halcon算子--图像、区域、轮廓、测量、拟合、垂足、夹角相关推荐

  1. halcon 亚像素定义以及测量拟合

    流程: 实现流程: 1>采集图像 2>预处理(RoI) :缩小干扰的区域 3>亚像素的边缘提取(xld) edges_sub_pix 边缘提取算子 threshold_sub_pix ...

  2. 基于Halcon提取图像外轮廓并提取保存轮廓相关数据

    *读取图片 dev_update_off () dev_close_window () dev_open_window (0, 0, 650, 485, 'black', WindowHandle) ...

  3. halcon中如何生成椭圆_Halcon中关于角度计算和测量拟合的算子详解

    角度计算算子简介 1.计算直线与水平轴之间的夹角 angle_lx( : : Row1, Column1, Row2, Column2 : Angle) 角度计算方式:将直线看作向量(有方向性),以直 ...

  4. Halcon缺陷检测——测量拟合

    缺陷检测--测量拟合 1. 简单聊一聊测量的那些事 2. 做几个测量判断缺陷的项目 案例1. 测量液体线高度 案例2. 检测矩形通孔的缺陷 下载地址: 1. 简单聊一聊测量的那些事 测量为什么也能做缺 ...

  5. 机器视觉测量拟合中级篇,halcon实战,measure测量助手

    机器视觉测量拟合中级篇,halcon实战测量助手 个人学习笔记 第一:快速使用measure测量助手进行识别: measure测量助手打开位置 进入measure测量助手的首页,第一使用对图像进行读取 ...

  6. HALCON示例程序measure_metal_part_first_example.hdev通过拟合边缘进行尺寸测量

    HALCON示例程序measure_metal_part_first_example.hdev通过拟合边缘进行尺寸测量 示例程序源码(加注释) 关于显示类函数解释 dev_update_off () ...

  7. Halcon算子学习:图像阈值分割-threshold、binary_threshold、dyn_threshold算子

    Halcon算子学习:图像阈值分割算子 前言 1.threshold-全局固定阈值分割 2.Binary Threshold-自动全局阈值分割 3.dyn_threshold-局部动态阈值分割 小结: ...

  8. halcon算子盘点:Chapter 13:对象、Chapter 14 区域

    Chapter 13:Object 13.1 Information 1. count_obj  功能:统计一个元组中的对象. 2. get_channel_info  功能:一幅目标图像组成部分的信 ...

  9. OpenCV_11 轮廓检测:图像的轮廓+绘制轮廓+轮廓近似+边界矩形+椭圆拟合+直线拟合

    1 图像的轮廓 轮廓可以简单认为成将连续的点(连着边界)连在一起的曲线,具有相同的颜色或者灰度.轮廓是图像目标的外部特征,这种特征对于我们进行图像分析,目标识别和理解等更深层次的处理都有很重要的意义. ...

最新文章

  1. VTK:字形2D用法实战
  2. QTP 11 补丁大全
  3. oracle-group by -having
  4. s5pv210——定时器理论与操作
  5. ADSL、SRA、HDSL
  6. MATLAB人脸识别系统[GUI界面,完美运行,详细解析]
  7. 加入收藏 设为首页代码收藏本页的代码和收藏本站的代码设为首页代码
  8. foxmail html模板,Foxmail“邮件模板”功能全攻略
  9. 网络安全实验室CTF—选择题解析 writeup
  10. 手机上如何让页面强制横屏
  11. 男神.png misc之图片lsb隐写
  12. word2016 上次启动时失败以安全模式能够解决该问题【office专业版】
  13. U盘中毒后里面的数据怎样恢复
  14. 剪辑手法中过肩拍摄的镜头怎么称呼?
  15. 2021-06-24CTF-攻防世界-WEB新手练习区(12题入门题)
  16. 计算机知识利用率,电脑CPU使用率怎么看 查看CPU使用率的快速方法图解
  17. FTDI 2232H GPIO设置 NAND Read
  18. 韬韬抢苹果 #普及组#
  19. SqlServer-STUFF理解基础知识
  20. 计算机网络——3A安全认证

热门文章

  1. mysql主从状态异常解决办法
  2. Eclipse 设置
  3. java 使用正则表达式过滤HTML中标签
  4. nodejs安装及环境配置(windows系统)
  5. 吐血实践 三核就是强过双核
  6. hp compaq presarop v3009笔记本重新启动蓝屏!
  7. 基于python的快速傅里叶变换FFT(一)
  8. 2020腾讯校招后台开发
  9. 记录一次读取hdfs文件时出现的问题java.net.ConnectException: Connection refused
  10. 2019.03.18 连接my sql