Image_Denoising/README.md
2025-04-15 12:48:09 +00:00

32 lines
1.4 KiB
Markdown
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# <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>
![高斯滤波](/effect_picture/1.高斯滤波.png#pic_center)
## 反谐波均值滤波
利用反谐波均值滤波处理胡椒噪声或盐噪声。<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>
![反谐波均值滤波](/effect_picture/2.反谐波均值滤波.png#pic_center)
## 自适应中值滤波
利用自适应中值滤波处理胡椒噪声或盐噪声。<br>
运行pepper_and_salt.py程序进行自适应中值滤波处理。<br>
如果需要修改处理文件请修改pepper_and_salt.py文件中的照片路径。
```c
image_saltandpep = cv2.imread("file/circuitboard-saltandpep.tif", cv2.IMREAD_GRAYSCALE)
```
程序效果展示如下。<br>
![自适应中值滤波](/effect_picture/3.自适应中值滤波.png#pic_center)