Edge Ex traction -- 边缘提取 楼主# 更多发布于:2013-11-06 12:09 以下内容来自 826 工作室 小马老师提供! 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 mo...