I have an image with an object like below: I can detect the contour and get a mask with only ball region, but my ROI is the edge region, that means I need a bigger and a smaller mask which combine to get this: so my question is: how can I shrink/enlarge the mask of contour around contour’s center? Answer