# Face Detection Results

The following XML shows a single record produced by face detection.

    <output>
      <record>
        ...
        <trackname>FaceDetect.Result</trackname>
        <FaceResult>
          <id>4895aeee-6a8f-44f9-915c-b86eff702118</id>
          <face>
            <region>
              <left>282</left>
              <top>84</top>
              <width>236</width>
              <height>236</height>
            </region>
            <outOfPlaneAngleX>0</outOfPlaneAngleX>
            <outOfPlaneAngleY>0</outOfPlaneAngleY>
            <percentageInImage>100</percentageInImage>
            <confidence>100</confidence>
            <ellipse>
              <center>
                <x>398.5</x>
                <y>194.25</y>
              </center>
              <a>106.25</a>
              <b>148.75</b>
              <angle>0</angle>
            </ellipse>
            <lefteye>
              <center>
                <x>441</x>
                <y>173</y>
              </center>
              <radius>16</radius>
            </lefteye>
            <righteye>
              <center>
                <x>356</x>
                <y>173</y>
              </center>
              <radius>16</radius>
            </righteye>
          </face>
        </FaceResult>
      </record>
    </output>

The record contains the following information:

- The `id` element provides a unique identifier for the detected face. The face detection engine issues an ID for each detected appearance of a face. If you are detecting faces in video and consecutive frames show the same face in a near-identical location, all records related to that appearance will have the same ID.

  For example, if a face appears in the same location for a hundred consecutive video frames, the engine uses the same ID for each record in the data track and the single record in the result track. The record in the result track will have a timestamp that covers all of the frames.

  If the face disappears and then reappears, the engine considers this as a new detection and produces a new ID and a new record in the result track.

- The `face` element contains the location of the detected face:

  - `region` describes the location of the face within the image or video frame. The `left` and `top` elements provide the position of the top-left corner of a rectangle that surrounds the face, and the `width` and `height` elements provide its size.
  - `outOfPlaneAngleX` indicates how far the person is looking to the left or right. `outOfPlaneAngleY` indicates how far the person is looking up or down. When both of these angles are zero, the person is looking directly at the camera.
  - `percentageInImage` indicates how much of the face is within the image boundary. If a face appears on the edge of an image and is only partially visible, this value will be less than `100`.
  - `confidence` is the face detection confidence score, from 0 to 100 where 100 indicates the greatest confidence. For Media Server to output a detected face, the confidence score must meet the threshold set by the `DetectionThreshold` parameter.
  - the `ellipse` element describes the location of the detected face as a circle or ellipse. When `DetectEyes=FALSE`, Media Server returns a circle that describes the approximate position of the face. When `DetectEyes=TRUE` and the person is looking towards the camera (so that `outOfPlaneAngleX` is less than `90`), Media Server returns an ellipse that should more accurately describe the position.
  - the `lefteye` and `righteye` elements describe eye locations. These are returned only if `DetectEyes=TRUE` and the person is looking towards the camera (so that `outOfPlaneAngleX` is less than `90`).

  TIP: Face detection can return co-ordinates that are negative. For example, in the `region` element the values for `left` and `top` can be negative if a face is detected on the edge of an image. In cases where a face fills the source image, the values for `width` and `height` might also exceed the image dimensions.

_FT_HTML5_bannerTitle.htm