'Return a mask of the convex hull of a blob.'

def _getHullMask(self, hull, bb):

    bb = cv.BoundingRect(hull)
    mask = cv.CreateImage((bb[2], bb[3]), cv.IPL_DEPTH_8U, 1)
    cv.Zero(mask)
    cv.DrawContours(mask, hull, 255, 0, 0, thickness=(-1), offset=(((-1) * bb[0]), ((-1) * bb[1])))
    return mask
