自适应中值滤波

This commit is contained in:
张梦南 2025-04-13 12:23:46 +08:00
parent 7c0a82ddc2
commit 90202a9736
2 changed files with 2 additions and 2 deletions

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')

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)