title: count Yaw and Roll in Python Head pose estimation MTCNN
body: <p>I have encountered  implementation of <code>MTCNN</code> network which is able to detect our head movement in 3 axis called Yaw,Roll and Pitch.</p>
  <p>Here are crucial elements:</p>
  <pre><code>bbox, points = detector.detect_faces(frame)
  </code></pre>
  <p><code>points</code>
  gives me keypoints list from network preduction such as:</p>
  <p><a href="https://i.stack.imgur.com/bgbK5.png" rel="noreferrer"><img src="https://i.stack.imgur.com/bgbK5.png" alt="enter image description here" /></a></p>
  <p>Drawing function:</p>
  <pre><code>def draw_landmarks(frame, bb, points):
      # draw rectangle and landmarks on face
      cv2.rectangle(frame,(int(bb[0]),int(bb[1])),(int(bb[2]),int(bb[3])),green,2)
      cv2.circle(frame, (points[0], points[5]), 2, (255,0,0), 2)# eye
      cv2.circle(frame, (points[1], points[6]), 2, (255,0,0), 2)
      cv2.circle(frame, (points[2], points[7]), 2, (255,0,0), 2)# nose
      cv2.circle(frame, (points[3], points[8]), 2, (255,0,0), 2)# mouth
      cv2.circle(frame, (points[4], points[9]), 2, (255,0,0), 2)
  </code></pre>
  <p>Now to detect some head movement in different axis there was defined Yaw and Roll functions.</p>
  <pre><code>def Roll(points):
      return points[6] - points[5]
  
  def Yaw(points):
      le2n = points[2] - points[0]
      re2n = points[1] - points[2]
      return le2n - re2n
  </code></pre>
  <p>Now having said that:</p>
  <p><code>&quot;Roll is the rotation about the x axis (between -180 and 180 deg)</code> <br>
  <code> Yaw is the rotation about the z axis (between -180 and 180).&quot;</code></p>
  <p>How does exactly Yaw  function work here? <br>
  Github:
  <a href="https://github.com/fisakhan/Face_Pose/blob/master/pose_detection_mtcnn.py" rel="noreferrer">https://github.com/fisakhan/Face_Pose/blob/master/pose_detection_mtcnn.py</a></p>