自适应中值滤波

This commit is contained in:
Cx330 committed 2025-04-13 12:23:46 +08:00
1 parent 7c0a82ddc2
commit 90202a9736
2 files changed
+2 -2

No files matched your search

+1 -1
View File
@@ -1,5 +1,5 @@
import numpy as np
# 自适应中值滤波
def adaptive_median_filter(image, max_window_size=7):
padded_image = np.pad(image, max_window_size // 2, mode='edge')
+1 -1
View File
@@ -3,7 +3,7 @@ import matplotlib.pyplot as plt
plt.rcParams['font.sans-serif'] = ['simHei']
plt.rcParams['axes.unicode_minus'] = False
from adaptive_median_filter import adaptive_median_filter
#读取照片
image_saltandpep = cv2.imread("file/circuitboard-saltandpep.tif", cv2.IMREAD_GRAYSCALE)