资源描述:
《halcon-edge extraction边缘提取》由会员上传分享,免费在线阅读,更多相关内容在教育资源-天天文库。
1、EdgeExtraction--边缘提取 楼主#更多发布于:2013-11-0612:09以下内容来自826工作室小马老师提供! 1.一般过程 ******************************************** * sobel_amp(Image : EdgeAmplitude : FilterType, Size :)* 不能完全排除虚假边缘,检测出的结果容易出现多像素边缘 * sobel算子由两个卷积核组成* a= 121 000 -1-2-1 b= 10-1 20-2 10-1 EdgeAmplitude output--边缘强度图像 FilterTy
2、pe 'sum_sqrt' sqrt(a^2+b^2)/4 'sum_abs'(
3、a
4、+
5、b
6、)/4 'thin_sum_abs'(thin(
7、a
8、)+thin(
9、b
10、))/4 'thin_max_abs'max(thin(
11、a
12、),thin(
13、b
14、))/4 'x'b/4 'y'a/4 ************************************************* 一个简单的例子dev_close_window() read_image(Image,'fuse') get_image_size(Image,Width,Height) dev_open_w
15、indow(0,0,Width,Height,'black',WindowHandle) *sobel算子 sobel_amp(Image,EdgeAmplitude,'thin_sum_abs',3)*二值 threshold(EdgeAmplitude,Region,30,255) *骨骼化--去掉多像素边缘 skeleton(Region,Skeleton) FilterImage HALCONoffersawiderangeofedgefilters.OneofthemostpopularfiltersistheSobelfilter.This isthebestoftheold-f
16、ashionedfilters.Itcombinesspeedwithareasonablequality.Thecorresponding operatorsarecalledsobel_ampandsobel_dir. Incontrast,edges_imageprovidesthestateoftheartofedgefilters.Thisoperatorisactuallymore thanjustafilter.Itincludesathinningoftheedgesusinganon-maximumsuppressionandahysteresis thresholdforthe
17、selectionofsignificantedgepoints.Italsoreturnstheedgedirectionandtheedge amplitudeveryaccurately,whichisnotthecasewiththeSobelfilter.Thisoperatorisrecommendedif higherqualityismoreimportantthanalongerexecutiontime.Iftheimagesarenotnoisyorblurred, youcanevencombineaccuracyandspeedbyusingthemode’sobel_
18、fast’insideedges_image.The correspondingoperatortofindedgesinmulti-channelimages,e.g.,acolorimage,isedges_color. HALCON提供广泛的边缘滤波器,最著名的是sobel滤波器,它是老式滤波器中最好的,对应的运算符为sobel_amp sobel_dir.edges_image更强大,它不仅仅是滤波器,包括了thin边缘二值化选择有效边缘点。返回theedgedirectionandtheedge amplitude,如果图像不是很多噪声且要追求追求高质量推荐使用此运算符。 sobel
19、_fast结合精度和速度edges_color多通道 ExtractEdges 提取边缘 Theeasiestwaytoextracttheedgesfromtheedgeamplitudeimageistoapplythresholdtoselect pixelswithahighedgeamplitude.Theresultofthisstepisaregionthatcontainsalledgepo