How can I programmatically dilate the contour of a given shape? Currently, I'm able to find and draw the contour of a shape using python+openCV, but I want to draw an offset to the contour of the shape in a raster image (like in the image below).
By offset, meaning expanding or minimizing the original shape, not just scaling it. The following is an example of that result: