title: Blur part of the video
body: <p>I am facing issues when trying to blur a video.</p>
  <p>The idea is, when I click on a frame, it has to blur the part of the video (as a rectangle).</p>
  <p>But, when I run the code, the whole video is appearing blurry. I want the rectangle part of it blurred.<br />
  Thank you.</p>
  <pre><code>def mouse_events(event,x,y,flags,params):
      global x_,y_, clicked
      if event == cv2.EVENT_LBUTTONDOWN:
          x_ = x
          y_ = y
          clicked = True
  
  
  def blur_rect(win):
      return cv2.GaussianBlur(win, (55, 55), 0)
  
  
  clicked = False
  x_ = 0
  y_ = 0
  cv2.namedWindow('frame')
  cv2.setMouseCallback('frame', mouse_events)
  
  cap = cv2.VideoCapture(0)
  while True:
      ret, frame = cap.read()
  
      if clicked:
          b = cv2.rectangle(frame, (x_-30, y_-30), (x_+50, y_+50), (0,255,0))             
          blurred = blur_rect(b)
  
      cv2.imshow(&quot;frame&quot;, blurred)
  
      k = cv2.waitKey(2) &amp; 0xFF
  
      if k == 27:
          break
  
  cap.release()
  cv2.destroyAllWindows()
  </code></pre>