均值滤波去噪numpy代码
时间: 2023-08-23 08:04:43 浏览: 75
以下为均值滤波的numpy代码:
```python
import numpy as np
from scipy.signal import convolve2d
def mean_filter(image, size):
rows, columns = image.shape
kernel = np.ones((size, size)) / (size ** 2)
filtered_image = convolve2d(image, kernel, mode='same')
return filtered_image
```
请问您是否还有其他问题需要我回答呢?
阅读全文