def sliding_window(image, stride=320, window_size=(320, 320)):
    """Extract patches according to a sliding window.根据一个滑动窗口提取补丁
    Args:
        image (numpy array): The image to be processed.要处理的图像
        stride (int, optional): The sliding window stride (defaults to 10px). 动窗口的跨度（默认为10px）
        window_size(int, int, optional): The patch size (defaults to (20,20)).补丁大小（默认为（20,20））
    Returns:
        list: list of patches with window_size dimensions
        具有window_size尺寸的补丁的列表
    """
    patches = []
    # slide a window across the image
    for x in range(0, image.shape[0], stride):
        for y in range(0, image.shape[1], stride):
            new_patch = image[x:x + window_size[0], y:y + window_size[1]]
            if new_patch.shape[:2] == window_size:
                patches.append(new_patch)
    return patches