title: Pad and increase image area to fit dilation output | opencv | python
body: <p>I am applying image dilation using opencv-python.</p>
  <p>This is the input image,</p>
  <p><a href="https://i.stack.imgur.com/tn7La.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/tn7La.png" alt="enter image description here" /></a></p>
  <p>After, applying dilation, the output is as follows,</p>
  <p><a href="https://i.stack.imgur.com/57fxC.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/57fxC.png" alt="enter image description here" /></a></p>
  <p>The dilated image is getting clipped by the edges of image. How can we increase the area of the output image automatically to fit the output of the dilation operation.</p>