Halcon-图像滤波(中值滤波和均值滤波)

均值滤波

*图像均值滤波
read_image (Image, 'claudia')
get_image_size (Image, Width, Height)
dev_close_window ()
dev_open_window_fit_size (0, 0, Width, Width, -1, -1, WindowHandle)
dev_display (Image)

*生成高斯噪声
gauss_distribution (20, Distribution)
add_noise_distribution (Image, ImageNoise, Distribution)
dump_window (WindowHandle, 'bmp', 'D:1/gauss_image')
mean_image (ImageNoise, ImageMean, 5, 5)
dump_window (WindowHandle, 'bmp', 'D:1/mean_image')


函数:高斯噪声gauss_distribution (20, Distribution)
均值滤波mean_image (ImageNoise, ImageMean, 5, 5)

在这里插入图片描述
中值滤波

*图像中值滤波
read_image (Image, 'claudia')
get_image_size (Image, Width, Height)
dev_close_window ()
dev_open_window_fit_size (0, 0, Width, Width, -1, -1, WindowHandle)
dev_display (Image)

*椒盐噪声分布
sp_distribution (5, 5, Distribution)
add_noise_distribution (Image, ImageNoise, Distribution)
dump_window (WindowHandle, 'bmp', 'D:1/sp_image')

*3x3
median_image (ImageNoise, ImageMedian, 'square', 3, 'mirrored')
dump_window (WindowHandle, 'bmp', 'D:1/3_image')

*5x5
median_image (ImageNoise, ImageMedian, 'square', 5, 'mirrored')
dump_window (WindowHandle, 'bmp', 'D:1/5_image')

*7x7
median_image (ImageNoise, ImageMedian, 'square', 7, 'mirrored')
dump_window (WindowHandle, 'bmp', 'D:1/7_image')

函数:median_image (ImageNoise, ImageMedian, ‘square’, 7, ‘mirrored’)

square为掩膜类型,可以选择圆形,矩形,线性等。

在这里插入图片描述

已标记关键词 清除标记
相关推荐
©️2020 CSDN 皮肤主题: 游动-白 设计师:白松林 返回首页