import numpy as np
from scipy import signal
import cv2
import random
import pinghua_zhongzhi ##用于向图像加入噪声
def guideFilter(I, p, winSize, eps, s): #导向滤波
# 输入图像的高、宽
h, w = I.shape[:2]
# 缩小图像
size = (int(round(w * s)), int(round(h * s)))
small_I = cv2.resize(I, size, interpolation=cv2.INTER_CUBIC)
small_p = cv2.resize(I, size, interpolation=cv2.INTER_CUBIC)
# 缩小滑动窗口
X = winSize[0]
small_winSize = (int(round(X * s)