title: Trying to blur the background of the image and bring a rectangular box on the face using python
body: <p>I am trying to bring a rectangular box on the face of the image first then I am trying to blur the background of the image in (frame variable) and extract face in (face variable)
  On executing the code I get Error: frame not defined.</p>
  <pre><code>import cv2
  import matplotlib.pyplot as plt
  
  image = cv2.imread('C:/Users/HP/l.jpg')
  #image=cv2.cvtColor(image, cv2.COLOR_BGR2RGB)
  image1 = cv2.cvtColor(image, cv2.COLOR_BGR2RGB)
  
  # Load the cascade
  detector = cv2.CascadeClassifier(&quot;haarcascade_frontalface_default.xml&quot;)
  
  plt.imshow(image1)
  faces = detector.detectMultiScale(
      image,
      scaleFactor=1.2,
      minNeighbors=10,
      minSize=(10, 50),
      
  )
  for (x, y, w, h) in faces:
      cv2.rectangle(image1, (x, y), (x+w, y+h), (1, 255, 4), 10)
      face=image1[y:y+h,x:x+w]
      frame=cv2.blur(image1,ksize = (10,10))
      frame[y:y+h,x:x+w]=face
  plt.imshow(frame)
  plt.show()
  
  plt.imshow(face)
  plt.show()
  </code></pre>