'Calculate the average color of a blob given the mask.'

def _getAvg(self, colorbitmap, bb, mask):

    cv.SetImageROI(colorbitmap, bb)
    avg = cv.Avg(colorbitmap, mask)
    cv.ResetImageROI(colorbitmap)
    return avg
