Edge Extraction 边缘提取

摘要:
sobel_快速结合了精度和速度边缘_彩色多通道提取边缘提取边缘从边缘幅度图像中提取边缘的最简单方法是使用重新折叠来选择具有高幅度的像素。这些结果是包含所有边缘点的区域。有了骨架,这些边缘可以与紫杉醇宽度相同。作为刷新的一个预先警告,可以使用异质阈值来消除不一致性。另一个高级选项是在删除之前调用操作器打开最大抑制方向,这表明在某些情况下可能会导致更精确的错误。请注意,为了使用此操作,您必须计算错误方向图像。与此相反,先进的替代边缘图像已经包括了非最大的抑制和阈值阈值。因此,在本例中,阈值仅为一个像素宽的提取边缘。如果只需要临界点区域,则可以使用操作员检查形状模型。这里,包括操作、非最大抑制和异阈值在内的所有步骤都高效地形成一个步骤。最简单的方法是对边缘幅度图像应用二值化,以计算具有高边缘梯度的点。结果是一个包含所有边点的区域。骨架用于将边的骨架设置为1像素的宽度。
1. 一般过程
Edge Extraction 边缘提取第1张
********************************************
*   sobel_amp(Image : EdgeAmplitude : FilterType, Size : )
*   不能完全排除虚假边缘,检测出的结果容易出现多像素边缘
*   sobel算子由两个卷积核组成
*          a =
 1 2 1
 0 0 0
 -1 -2 -1
 b =
 1 0 -1
 2 0 -2
 1 0 -1
EdgeAmplitude output -- 边缘强度图像
FilterType
         'sum_sqrt'             sqrt(a^2 + b^2) / 4
 'sum_abs' (|a| + |b|) / 4
 'thin_sum_abs' (thin(|a|) + thin(|b|)) / 4
 'thin_max_abs' max(thin(|a|),thin(|b|)) / 4
 'x' b / 4
 'y' a / 4
 
*************************************************
 
一个简单的例子
dev_close_window()
read_image(Image,'fuse')
get_image_size(Image,Width,Height)
dev_open_window(0,0,Width,Height,'black',WindowHandle)
*sobel 算子
sobel_amp(Image,EdgeAmplitude,'thin_sum_abs',3)
*二值
threshold(EdgeAmplitude,Region,30,255)
*骨骼化 -- 去掉多像素边缘
skeleton(Region,Skeleton)
 
 
 
Filter Image
 
HALCON offers a wide range of edge filters. One of the most popular filters is the Sobel filter. This
is the best of the old-fashioned filters. It combines speed with a reasonable quality. The corresponding
operators are called sobel_amp and sobel_dir.
In contrast, edges_image provides the state of the art of edge filters. This operator is actually more
than just a filter. It includes a thinning of the edges using a non-maximum suppression and a hysteresis
threshold for the selection of significant edge points. It also returns the edge direction and the edge
amplitude very accurately, which is not the case with the Sobel filter. This operator is recommended if
higher quality is more important than a longer execution time. If the images are not noisy or blurred,
you can even combine accuracy and speed by using the mode ’sobel_fast’ inside edges_image. The
corresponding operator to find edges in multi-channel images, e.g., a color image, is edges_color.
 
HALCON 提供广泛的边缘滤波器,最著名的是sobel滤波器,它是老式滤波器中最好的,对应的运算符为sobel_amp  sobel_dir.
edges_image更强大,它不仅仅是滤波器,包括了 thin边缘 二值化选择有效边缘点。返回 the edge direction and the edge
amplitude ,如果图像不是很多噪声且要追求追求高质量推荐使用此运算符。
sobel_fast 结合精度和速度
edges_color 多通道
 
Extract Edges  提取边缘
The easiest way to extract the edges from the edge amplitude image is to apply threshold to select
pixels with a high edge amplitude. The result of this step is a region that contains all edge points. With
skeleton, these edges can be thinned to a width of one pixel. As an advanced version for threshold,
hysteresis_threshold can be used to eliminate insignificant edges. A further advanced option is to
call the operator nonmax_suppression_dir before skeleton, which in difficult cases may result in
more accurate edges. Note that in order to use this operator you must have computed the edge direction
image.
In contrast, the advanced filter edges_image already includes the non-maximum suppression and the
hysteresis threshold. Therefore, in this case a simple threshold suffices to extract edges that are one
pixel wide.
If only the edge points as a region are needed, the operator inspect_shape_model can be used. Here,
all steps including edge filtering, non-maximum suppression, and hysteresis thresholding are performed
in one step with high efficiency.
 
最简单的方法是 对 edge amplitude 图像 应用 二值化 算则高边缘梯度的点。
结果是一个包含所有边缘点的区域,用 skeleton 骨骼化边缘 成1 像素宽度。
更先进的二值化方法hysteresis_threshold 可以去除无关紧要的边缘。
更进一步的操作是在用 skeleton之前 先用一下nonmax_suppression_dir (它也有细化的效果,使用它的前题是 需要 Edge Dirction 图像)
 
相对来说edges_image 包含了上述的操作,因为提取出的边缘是1像素宽度
 
如果边缘点 仅仅是作为 region的话 ,可以用inspect_shape_model ,这个运算符包括
all steps including edge filtering, non-maximum suppression, and hysteresis thresholding are performed
in one step with high efficiency.
 
Process Edge
 
If you want to extract the coordinates of edge segments, split_skeleton_lines is the right choice.
This operator must be called for each connected component (result of connection) and returns all the
control points of the line segments. As an alternative, a Hough transform can be used to obtain the
line segments. Here, the operators hough_lines_dir and hough_lines are available. You can also
convert the edge region into XLD contours by using, e.g., the operator gen_contours_skeleton_xld.
 
The advantage of this approach is the extended set of operators offered for XLD contour processing on
page 81, e.g., for contour segmentation, feature extraction, or approximation.
You can extract the regions enclosed by the edges easily using background_seg. If regions merge
because of gaps in the edges, the operators close_edges or close_edges_length can be used in
advance to close the gaps before regions are extracted. As an alternative, morphological operators like
opening_circle can be applied to the output regions of background_seg. In general, all operators
described for the method Process Regions on page 33 can be applied here as well.
 
 
一个例子 Example: solution_guide/basics/edge_segments.hdev
Edge Extraction 边缘提取第2张
 
********************************************
*    edges_image(Image : ImaAmp, ImaDir : Filter,
*                             Alpha,           * 平滑用的
*                           NMS,               * nonmax_suppression_dir(...,NMS,...)
*                        Low, High : )       *hysteresis_threshold(...,Low,High,999,...)
*                    
*           低于Low的灰度值舍去 高于High的灰度值保留,中间的看情况
*   
*********************************************
read_image(Image,'mreut')
get_image_size(Image,Width,Height)
dev_close_window()
dev_open_window(0,0,Width,Height,'black',WindowHandle)

edges_image (Image, ImaAmp, ImaDir, 'canny', 1, 'nms', 20, 40)

threshold (ImaDir, Regions,1, 255)

connection(Regions,ConnectionRegions)

count_obj(ConnectionRegions,Number)

gen_empty_obj(XLDContours)

dev_clear_window()
for i :=1 to Number by 1
    select_obj(ConnectionRegions,SingleEdgeObject,i)
    split_skeleton_lines(SingleEdgeObject,2,BeginRow,BeginCol,EndRow,EndCol)
    for k :=0 to |BeginRow|-1 by 1
        gen_contour_polygon_xld(Contour,[BeginRow[k],EndRow[k]],[BeginCol[k],\
                                EndCol[k]])
        concat_obj(XLDContours,Contour,XLDContours)
    endfor
endfor

dev_display(XLDContours)
 
 
个例子 segmenting a color image
Edge Extraction 边缘提取第3张
 
*******************************************
*    edges_color(Image : ImaAmp, ImaDir : Filter, Alpha, NMS, Low, High : )
*     根据颜色来提取边缘 与 edges_image 不同的地方 如图 b c 所示,足球场 红色和绿色分开了
*******************************************
dev_update_window('off')
dev_update_pc('off')
dev_update_var('off')
read_image(Image,'olympic_stadium')
get_image_size(Image,Width,Height)
dev_close_window()
dev_open_window(0,0,Width,Height,'black',WindowHandle)

edges_color (Image, ImaAmp, ImaDir, 'canny', 1, 'nms', 20, 40)
threshold(ImaAmp,RegionColor,1,255)
skeleton(RegionColor,EdgesColor)
dev_display(Image)
dev_display(EdgesColor)
stop()
 
 
 

 
 



通过 Wiz 发布



免责声明:文章转载自《Edge Extraction 边缘提取》仅用于学习参考。如对内容有疑问,请及时联系本站处理。

上篇JS-OC通信之Cordova简介C# 获取config文件 实体转换下篇

宿迁高防,2C2G15M,22元/月;香港BGP,2C5G5M,25元/月 雨云优惠码:MjYwNzM=

相关文章

TI AM335X 网卡驱动解析

1.CPSW驱动及设备的初始化; (1)首先驱动注册cpsw_driver ,会自动进入cpsw_probe执行; 1 static struct platform_driver cpsw_driver = { 2 .driver = { 3 .name = "cpsw", 4 .owner = T...

Scss与Less区别

Scss与Less区别 一. Sass/Scss、Less是什么? Sass (Syntactically Awesome Stylesheets)是一种动态样式语言,Sass语法属于缩排语法,比css比多出好些功能(如变量、嵌套、运算,混入(Mixin)、继承、颜色处理,函数等),更容易阅读。 Sass与Scss是什么关系? Sass的缩排语法,对于写惯...

去除win10中Edge的新建标签页广告

听人安利多了microsoft的Edge浏览器各种好处,想着也许就可以替代chrome了也不错,至少可以少安装一个浏览器,装上之后,的确比较香,但是每次新建标签页就是: 在菜单中设置--隐私、搜索和服务--防止跟踪--跟踪防护--严格 最后的效果: 后来发现在页面设置中--页面布局--自定义{ 显示快速链接:关闭 背景:关闭 内容:内容关闭 } 就会有...

ubuntu磁盘分配和挂载

Linux(ubuntu)可以把分区作为挂载点,常用的几个挂载点、作用及一般应该分配的磁盘空间如下表所示:Markdown Extra 表格语法: 挂载点(目录) 建议大小 格式 作用 / 20G左右 ext4 根目录 /home 越大越好 ext4 用户工作目录,用户存储的数据,文件,安装的软件都存放在这儿 /boot 300M左右 e...

在实际项目中使用git推代码踩过的坑

Git使用中出现的状况: BUG集锦: On branch dev nothing to commit, working tree clean 说明在dev分支上,没有什么提交,很干净; 2.fatal:couldn't find remote ref dev 新建项目时,pull出现的报错信息,说明项目还有有文件,时空的直接进行推代码 3.git p...

Linux下的静态路由配置

在日常运维作业中,经常会碰到路由表的操作。下面就linux运维中的路由操作做一梳理:------------------------------------------------------------------------------先说一些关于路由的基础知识:1)路由概念路由:   跨越从源主机到目标主机的一个互联网络来转发数据包的过程路由器:能够...