自适应中值滤波
This commit is contained in:
parent
7c0a82ddc2
commit
90202a9736
@ -1,5 +1,5 @@
|
|||||||
import numpy as np
|
import numpy as np
|
||||||
|
|
||||||
# 自适应中值滤波
|
# 自适应中值滤波
|
||||||
def adaptive_median_filter(image, max_window_size=7):
|
def adaptive_median_filter(image, max_window_size=7):
|
||||||
padded_image = np.pad(image, max_window_size // 2, mode='edge')
|
padded_image = np.pad(image, max_window_size // 2, mode='edge')
|
||||||
|
@ -3,7 +3,7 @@ import matplotlib.pyplot as plt
|
|||||||
plt.rcParams['font.sans-serif'] = ['simHei']
|
plt.rcParams['font.sans-serif'] = ['simHei']
|
||||||
plt.rcParams['axes.unicode_minus'] = False
|
plt.rcParams['axes.unicode_minus'] = False
|
||||||
from adaptive_median_filter import adaptive_median_filter
|
from adaptive_median_filter import adaptive_median_filter
|
||||||
|
|
||||||
#读取照片
|
#读取照片
|
||||||
image_saltandpep = cv2.imread("file/circuitboard-saltandpep.tif", cv2.IMREAD_GRAYSCALE)
|
image_saltandpep = cv2.imread("file/circuitboard-saltandpep.tif", cv2.IMREAD_GRAYSCALE)
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user