In [9]:
# Here we can extract only deteceted face
newImage = image[startY+2:endY-2, startX+2:endX-2]
cv2.imwrite("face.jpg", newImage)
Out[9]:
True