计算机视觉 非线性平滑滤波算法
计算机视觉非线性平滑滤波算法(中值滤波),显示图3-9# -*- coding: utf-8 -*-# @Time: 2021/4/15 14:58# @Author: weiwei# @File: 3.9.pyfrom scipy import ndimagefrom skimage import data, utilfrom matplotlib import pyplot as pltimg
·
计算机视觉
非线性平滑滤波算法(中值滤波),显示图3-9
# -*- coding: utf-8 -*-
# @Time : 2021/4/15 14:58
# @Author : weiwei
# @File : 3.9.py
from scipy import ndimage
from skimage import data, util
from matplotlib import pyplot as plt
img = data.astronaut()[:, :, 0]
noise_img = util.random_noise(img, mode='s&p', seed=None, clip=True)
n = 3
new_img = ndimage.median_filter(noise_img, (n, n))
plt.figure()
plt.subplot(1, 3, 1)
plt.imshow(img, cmap='gray')
plt.subplot(1, 3, 2)
plt.imshow(noise_img, cmap='gray')
plt.subplot(1, 3, 3)
plt.imshow(new_img, cmap='gray')
plt.show()
更多推荐
7日热学榜
活动日历
查看更多
活动时间 2025-01-01 00:00:00

丁奇:MySQL高频面试题详解
活动时间 2025-01-01 00:00:00

AI 大模型应用开发 · 实战营
活动时间 2025-01-01 00:00:00

AI系列课程-IT全学科自学科
活动时间 2025-01-01 00:00:00

3 小时掌握 Prompt 核心技巧与 GPT 技术理论
活动时间 2025-01-01 00:00:00

0基础2个月拿下软考高级证书体验课
目录
所有评论(0)