title: How to save cropped image using openCV?
body: <p>I am capturing image using opencv and face_recognition library in python,
  Here is the snippet of my program</p>
  <pre><code>while True:
  ret,frame = video_capture.read()
  rgb_frame = frame[:,:,::-1]
  face_locations = fr.face_locations(rgb_frame)
  face_encodings = fr.face_encodings(rgb_frame,face_locations)
  cv2.imwrite('test.png', frame)
  if len(face_encodings)!=0:
      print(face_locations)
      temp = list(face_locations[0])
      img = cv2.imread('test.png')
      cropped = img[temp[0]:temp[2],temp[0]:temp[1]]
      cv2.imshow(&quot;cropped&quot;, cropped)
      cv2.imwrite('face.png',cropped)
  </code></pre>
  <p>I am trying to save cropped image to my directory. But the code above doesn't work. Do you know the way how can I save cropped Image using opencv ?</p>