title: image processing (face detection): how to detect whole face up to hair?
body: <p>I want to detect the whole head from chin to the top of the hair to calculate its size.</p>
  <p>I have a simple face detection code with python/openCV :</p>
  <pre><code>import cv2
  import os
  
  dir_path = os.path.dirname(os.path.realpath(__file__))
  faceCascade = cv2.CascadeClassifier(os.path.join(dir_path, 'haarcascade_frontalface_default.xml'))
  
  image_name = input()
  image = cv2.imread(os.path.join(dir_path, image_name))
  
  gray = cv2.cvtColor(image, cv2.COLOR_BGR2GRAY)
  
  faces = faceCascade.detectMultiScale(
      gray,
      scaleFactor=1.1,
      minNeighbors=5,
      flags=cv2.CASCADE_SCALE_IMAGE
      )
  
  for (x, y, w, h) in faces:
      cv2.rectangle(image, (x, y), (x+w, y+h), (255, 255, 255), 3)
  
  print('{} faces detected.'.format(len(faces)))
  cv2.imshow('image', image)
  cv2.waitKey()
  
  cv2.imwrite(os.path.join(dir_path, image_name[:image_name.find('.') + 1] + '_resault.jpg'), image)
  
  </code></pre>
  <p>this detect the face from the chin to the top of the forehead like this:
  <img src="https://i.stack.imgur.com/L2zHg.jpg" alt="current detection" /></p>
  <p>the problem is I want to calculate the height of the face to the top of the hair like this:
  <img src="https://i.stack.imgur.com/sn0Py.jpg" alt="wanted behavior" /></p>
  <p>how can I detect the whole head from the chin to the top of the hair ?</p>