halcon-周期性噪声去除



参考了HALCON例程和其他网友的思路, 简单地去除周期性噪声方法如下. 因是初学者,所以有错误的地方还请多多指正.



halcon-周期性噪声去除_第1张图片



read_image (Image1, 'C:/PJ_HalCon/滤波去噪/周期噪声/1.jpg')
get_image_size (Image1, Width, Height)
fft_generic (Image1, ImageFFT, 'to_freq', -1, 'sqrt', 'dc_center', 'complex')


dev_set_draw ('margin')


power_real (ImageFFT, ImageResult)
binomial_filter (ImageResult, ImageBinomial, 5, 5)
threshold (ImageBinomial, Region, 100, 10000)
connection (Region, ConnectedRegions)


select_shape (ConnectedRegions, SelectedRegions, 'area', 'and', 5, 200)
union1 (SelectedRegions, RegionUnion)
reduce_domain (ImageBinomial, RegionUnion, ImageReduced)
local_max (ImageReduced, LocalMaxima)


shape_trans (LocalMaxima, RegionTrans, 'convex')


dilation_circle (RegionUnion, RegionDilation, 3)


paint_region (RegionDilation, ImageFFT, ImageResult1, 0, 'fill') 
fft_generic (ImageResult1, ImageFFT1, 'from_freq', 1, 'sqrt', 'dc_center', 'byte')
dev_display (ImageFFT1)



 处理后的结果,下图. 大部分处理了,但还有四周少量的未能处理掉, 不知哪位指点一二.


 

halcon-周期性噪声去除_第2张图片


你可能感兴趣的:(halcon-周期性噪声去除)