import math


def extract_blob(blob, image):
    """ Extract the pixels that make up the blob's neighbourhood

    :param blob: the blob to extract
    :param image: the image to extract the blob from
    :returns: extracted square neighbourhood
    """
    y, x, r = blob
    hs, he = y - math.floor(r), y + math.floor(r)
    ws, we = x - math.floor(r), x + math.floor(r)
    image_section = image[hs:he, ws:we]
    return image_section