HALCON轮廓整理

*轮廓的创建,区域边缘生成轮廓,提取,分割,合并
*画圆生成圆轮廓
draw_circle (3600, Row, Column, Radius)
gen_circle_contour_xld (ContCircle, Row, Column, Radius, 0, 6.28318, 'positive', 1)
*画矩形生成矩形轮廓
draw_rectangle2 (3600, Row1, Column1, Phi, Length1, Length2)
gen_rectangle2_contour_xld (Rectangle, Row1, Column1, Phi, Length1, Length2)
*生成箭头轮廓
gen_arrow_contour_xld (Arrow, Row, Column, Row1, Column1, 25, 50)
*生成十字叉轮廓
gen_cross_contour_xld (Cross, Row, Column, 25, 0)
*画一个区域并将将区域边缘生成轮廓
draw_region (Region, 3600)
gen_contour_region_xld (Region, Contours, 'border')
*区域生成骨骼,骨骼转轮廓
skeleton (Region, Skeleton)
gen_contours_skeleton_xld (Skeleton, Contours1, 1, 'filter')
*图像边缘提取得到轮廓
read_image (Image, 'fabrik')
threshold_sub_pix (Image, Border, 128)
*带通滤波:滤波器是提取出图像,白的更白,黑的更黑
bandpass_image (Image, ImageBandpass, 'lines')
threshold_sub_pix (ImageBandpass, Border, 128)
*索蓓尔放大器,把边缘区域变亮,不是边缘的都变暗,也是梯度值变化,就是保留梯度值变化的位置
sobel_amp (ImageBandpass, EdgeAmplitude, 'sum_abs', 3)
threshold_sub_pix (EdgeAmplitude, Border, 128)
*高通滤波器:梯度值低和高的变化会变亮
highpass_image (EdgeAmplitude, Highpass, 9, 9)
*亚像素提取轮廓,通过过滤器和梯度变化率来获取边缘
edges_sub_pix (Image, Edges, 'canny', 1, 20, 40)
*从最大宽度和提取线的对比度计算出lines_gauss的参数Sigma、Low和High。
calculate_lines_gauss_parameters (8, [12,0], Sigma, Low, High)
*精确的抽出线,返回亚像素轮廓,三平滑系数,四五阈值范围,越小线越多,第六个参数标识提
*取亮线还是暗线,七,是否提取线的宽度(如果获取线的宽度,则线提前的位置越宽则显示的线就越宽)
lines_gauss (Highpass, Lines, Sigma, Low, High, 'light', 'true', 'bar-shaped', 'true')
circularity_xld (Lines, Circularity)//获取圆度
length_xld (Lines, Length)//获取长度
area_center_xld (Lines, Area, Row2, Column2, PointOrder)//获取面积中心点
*轮廓等高线过滤
select_contours_xld (Lines, SelectedContours, 'contour_length', 20, 200, -0.5, 0.5)
*轮廓几何形状过滤
select_shape_xld (SelectedContours, SelectedXLD, 'area', 'and', 150, 99999)

posted @ 2019-05-04 14:44  西牛皮  阅读(9388)  评论(0编辑  收藏  举报