title: Blur a specific part of an image
body: <p>I have an image. Like this:</p>
  
  <p><a href="https://i.stack.imgur.com/qjgGY.jpg" rel="noreferrer"><img src="https://i.stack.imgur.com/qjgGY.jpg" alt="enter image description here"></a></p>
  
  <p>I detect a subject(which is a person in this case) &amp; it masks the image like this:</p>
  
  <p><a href="https://i.stack.imgur.com/JoOyX.png" rel="noreferrer"><img src="https://i.stack.imgur.com/JoOyX.png" alt="enter image description here"></a></p>
  
  <p>I want the background of the subject to be blurrred. Like this:</p>
  
  <p><a href="https://i.stack.imgur.com/mzb4B.jpg" rel="noreferrer"><img src="https://i.stack.imgur.com/mzb4B.jpg" alt="enter image description here"></a></p>
  
  <p>Below is the code I have tried. the following code only blurs</p>
  
  <pre><code>import cv2
  import numpy as np
  from matplotlib import pyplot as plt
  import os
  
  
  path = 'selfies\\'
  selfImgs = os.listdir(path)
  
  
  for image in selfImgs:
  
      img = cv2.imread(path+image)
      img=cv2.cvtColor(img, cv2.COLOR_BGR2RGB)
      blur = cv2.blur(img,(10,10))
      #canny = cv2.Canny(blur, 10, 30)
  
      #plt.imshow(canny)
      plt.imshow(blur)
  
      j=cv2.cvtColor(blur, cv2.COLOR_BGR2RGB)
      print(image)
      cv2.imwrite('blurred\\'+image+".jpg",j)
  </code></pre>
  
  <p>Is there any way by which I can blur only specific part/parts of the image.</p>
  
  <p>This project is based on <a href="https://github.com/matterport/Mask_RCNN" rel="noreferrer">https://github.com/matterport/Mask_RCNN</a></p>
  
  <p>I can provide more information if required.</p>
  
  <p>I have an approach in numpy :-</p>
  
  <pre><code>final_image = original * mask + blurred * (1-mask)
  </code></pre>