图像处理(Python)
发布时间
阅读量:
阅读量
高斯型噪声(Gaussian-type noise)和椒盐型噪声(salt-and-pepper noise/SP noise)均可通过Python库:skimage实现
#import os #import语句的作用是用来导入模块,可以出现在程序任何位置
import cv2 as cv #导入openCV库
import skimage #导入skimage模块.scikit-image是一个图像处理算法的集合。它是基于scipy的一款图像处理包,它将图片作为numpy数组进行处理,方便进行后续运算。
#必须首先安装numpy,scipy,matplotlib
import numpy as np #导入numpy模块。numpy是python扩展程序库,支持数组和矩阵运算,针对数组运算提供大量数学函数库。
def boxBlur(img):
# 使用5x5的滤波核进行平滑
blur = cv.boxFilter(img,-1,(5, 5))
return blur
def gaussianBlur(img):
#
全部评论 (0)
还没有任何评论哟~
