I have object's bounding rect and contour. I want to use a contour as a mask to enlarge boundaries of this object to the size of bounding rect. In other words if object with green boundary pixels fitted in rectangle is on black background I want to make black pixels green.
How to do that?