32 lines
1.4 KiB
Markdown
32 lines
1.4 KiB
Markdown
# <p align="center">图像去噪</p>
|
||
## 运行库
|
||
cv2、matplotlib、numpy<br>
|
||
contraharmonic_mean_filter.py、adaptive_median_filter.py
|
||
## 高斯滤波
|
||
利用高斯滤波处理高斯噪声。<br>
|
||
运行gaussian.py程序进行高斯滤波处理。<br>
|
||
如果需要修改处理文件,请修改gaussian.py文件中的照片路径。
|
||
```c
|
||
image_gaussian = cv2.imread("file/circuitboard-gaussian.tif")
|
||
```
|
||
程序效果展示如下。<br>
|
||

|
||
## 反谐波均值滤波
|
||
利用反谐波均值滤波处理胡椒噪声或盐噪声。<br>
|
||
运行pepper_salt.py程序进行反谐波均值滤波处理。<br>
|
||
如果需要修改处理文件,请修改pepper_salt.py文件中的照片路径。
|
||
```c
|
||
image_pepper = cv2.imread("file/circuitboard-pepper.tif", cv2.IMREAD_GRAYSCALE)
|
||
image_salt = cv2.imread("file/circuitboard-salt.tif", cv2.IMREAD_GRAYSCALE)
|
||
```
|
||
程序效果展示如下。<br>
|
||

|
||
## 自适应中值滤波
|
||
利用自适应中值滤波处理胡椒噪声或盐噪声。<br>
|
||
运行pepper_and_salt.py程序进行自适应中值滤波处理。<br>
|
||
如果需要修改处理文件,请修改pepper_and_salt.py文件中的照片路径。
|
||
```c
|
||
image_saltandpep = cv2.imread("file/circuitboard-saltandpep.tif", cv2.IMREAD_GRAYSCALE)
|
||
```
|
||
程序效果展示如下。<br>
|
||
 |