数字图像处理实验-空域滤波
1、利用均值模板平滑灰度图像
具体内容: 利用 OpenCV 对图像像素进行操作,分别利用 33、55 和 9*9 尺寸的均值模板平滑灰度图像。
完成程度:对原图像进行边缘填充,用周围的像素点灰度值代替图像边缘的值,构造了33、55、7*7的均值模板,对灰度图像进行均值计算操作,将得到的均值赋值给对应的新矩阵。
1 |
|

2、利用高斯模板平滑灰度图像
具体内容: 利用 OpenCV 对图像像素进行操作,分别利用 33、55 和 9*9 尺寸的高斯模板平滑灰度图像。
完成程度:通过高斯函数自定义构造33、55、7*7的高斯模板,编写卷积运算的函数,并将原灰度图与所构造的高斯模板进行卷积操作,得到平滑后的图像并输出。
1 |
|


3、利用 Laplacian、Robert、Sobel 模板锐化灰度图像
具体内容: 利用 OpenCV 对图像像素进行操作,分别利用 Laplacian、Robert、Sobel 模板锐化灰度图像。
完成程度:分别构造Laplacian、Robert、Sobel模板,用这三个模板分别原始图像进行卷积操作,得到结果后输出
1 |
|
Laplacian

Robert

Sobel

4、利用高提升滤波算法增强灰度图像
具体内容: 利用 OpenCV 对图像像素进行操作,设计高提升滤波算法增强图像。
完成程度:使用高斯滤波平滑原始图像,将原始图像减去平滑后的图像,得到高斯滤波过滤掉的细节图像,给细节图像乘上一定的倍数(本实验所用的倍数是2),再加到原始图像中,输出图像。
1 |
|

5、利用均值模板平滑彩色图像
具体内容:利用 OpenCV 分别对图像像素的 RGB 三个通道进行操作,利用 33、55 和 9*9 尺寸的均值模板平滑彩色图像。
完成程度:在完成了均值滤波平滑灰度图像的基础上,分离彩色图像的三个通道,分别对其三个通道进行平滑处理,完成以后再合并输出。
1 |
|


6、利用高斯模板平滑彩色图像
具体内容:利用 OpenCV 分别对图像像素的 RGB 三个通道进行操作,分别利用 33、55 和 9*9 尺寸的高斯模板平滑彩色图像。
完成程度:在完成了高斯滤波平滑灰度图像的基础上,分离彩色图像的三个通道,分别对其三个通道进行平滑处理,完成以后再合并输出。
1 |
|


7、利用 Laplacian、Robert、Sobel 模板锐化彩色图像
具体内容:利用 OpenCV 分别对图像像素的 RGB 三个通道进行操作,分别利用 Laplacian、Robert、Sobel 模板锐化彩色图像。
完成程度:构造Laplacian、Robert、Sobel算子,分别对彩色图像的三个通道进行卷积操作,完成以后进行通道合并,并输出合并后的彩色图像。
1 |
|
Laplacian

Robert

Sobel
