图像滤波+边缘检测+图像增强实例

read_image (Image, 'fabrik')
*均值滤波
mean_image (Image, ImageMean, 9, 9)
*递归滤波器进行滤波
smooth_image (Image, ImageSmooth, 'deriche2', 0.5)
*sigma标准方差进行非线性滤波
sigma_image (Image, ImageSigma, 5, 5, 3)
*使用离散高斯函数对图像进行滤波
gauss_image (Image, ImageGauss, 5)
*中值滤波
median_image (Image, ImageMedian, 'circle', 1, 'mirrored')
 
 
*****边缘检测
*用frei_chen方法进行边缘检测
frei_amp (Image, ImageEdgeAmp)
*用Kirsch方法进行边缘检测
kirsch_amp (Image, ImageEdgeAmp1)
*用prewitt方法进行边缘检测
prewitt_amp (Image, ImageEdgeAmp2)
*用Sobel方法进行边缘检测
sobel_amp (Image, ImageEdgeAmp3, 'sum_abs', 3)
*抑制边缘上的非极大值点
nonmax_suppression_amp (Image, ImageResult, 'hvnms')
 
 
*****图像增强
*效果很明显,使得图像更清晰,可以提高边缘的质量,最后一个系数代表增强对比度的系数
emphasize (Image, ImageEmphasize, 7, 7, 5)
*增加图像对比度算子
*算法原理为图像很暗的部分可以变得很亮,很亮的部分可以变得更暗
*用算子mean_image进行低通滤波,滤波的掩膜尺寸的MaskWidth*MaskHeight
*假设原始图像的灰度为orig,mean_image滤波后灰度值为mean,结果灰度图像值为new
*对于位图val=127公式如下
*new=round((val-mean)*Factor+orig)
*其中Factor为系数 40 40 0.55  100 100 0.7 150 150 0.8
illuminate (Image, ImageIlluminate, 101, 101, 0.7)

猜你喜欢

转载自www.cnblogs.com/hu16683845/p/9185808.html
今日推荐