# Cloud Vision V1 Client - Class FaceAnnotation (2.2.1)

2.2.1 (latest) 2.2.0 2.1.3 2.0.3 1.10.3 1.9.4 1.8.0 1.7.6 1.6.8 Reference documentation and code samples for the Cloud Vision V1 Client class FaceAnnotation.

A face annotation object contains the results of face detection.

Generated from protobuf message `google.cloud.vision.v1.FaceAnnotation`

## Namespace

Google \\ Cloud \\ Vision \\ V1

## Methods

### __construct

Constructor.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `data` | `array` Optional. Data for populating the Message object. |
| `↳ bounding_poly` | `https://docs.cloud.google.com/php/docs/reference/cloud-vision/latest/V1.BoundingPoly` The bounding polygon around the face. The coordinates of the bounding box are in the original image's scale. The bounding box is computed to "frame" the face in accordance with human expectations. It is based on the landmarker results. Note that one or more x and/or y coordinates may not be generated in the `BoundingPoly` (the polygon will be unbounded) if only a partial face appears in the image to be annotated. |
| `↳ fd_bounding_poly` | `https://docs.cloud.google.com/php/docs/reference/cloud-vision/latest/V1.BoundingPoly` The `fd_bounding_poly` bounding polygon is tighter than the `boundingPoly`, and encloses only the skin part of the face. Typically, it is used to eliminate the face from any image analysis that detects the "amount of skin" visible in an image. It is not based on the landmarker results, only on the initial face detection, hence the `fd` (face detection) prefix. |
| `↳ landmarks` | `array<https://docs.cloud.google.com/php/docs/reference/cloud-vision/latest/V1.FaceAnnotation.Landmark>` Detected face landmarks. |
| `↳ roll_angle` | `float` Roll angle, which indicates the amount of clockwise/anti-clockwise rotation of the face relative to the image vertical about the axis perpendicular to the face. Range \[-180,180\]. |
| `↳ pan_angle` | `float` Yaw angle, which indicates the leftward/rightward angle that the face is pointing relative to the vertical plane perpendicular to the image. Range \[-180,180\]. |
| `↳ tilt_angle` | `float` Pitch angle, which indicates the upwards/downwards angle that the face is pointing relative to the image's horizontal plane. Range \[-180,180\]. |
| `↳ detection_confidence` | `float` Detection confidence. Range \[0, 1\]. |
| `↳ landmarking_confidence` | `float` Face landmarking confidence. Range \[0, 1\]. |
| `↳ joy_likelihood` | `int` Joy likelihood. |
| `↳ sorrow_likelihood` | `int` Sorrow likelihood. |
| `↳ anger_likelihood` | `int` Anger likelihood. |
| `↳ surprise_likelihood` | `int` Surprise likelihood. |
| `↳ under_exposed_likelihood` | `int` Under-exposed likelihood. |
| `↳ blurred_likelihood` | `int` Blurred likelihood. |
| `↳ headwear_likelihood` | `int` Headwear likelihood. |

### getBoundingPoly

The bounding polygon around the face. The coordinates of the bounding box
are in the original image's scale.

The bounding box is computed to "frame" the face in accordance with human
expectations. It is based on the landmarker results.
Note that one or more x and/or y coordinates may not be generated in the
`BoundingPoly` (the polygon will be unbounded) if only a partial face
appears in the image to be annotated.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/php/docs/reference/cloud-vision/latest/V1.BoundingPoly|null` |   |

### hasBoundingPoly

### clearBoundingPoly

### setBoundingPoly

The bounding polygon around the face. The coordinates of the bounding box
are in the original image's scale.

The bounding box is computed to "frame" the face in accordance with human
expectations. It is based on the landmarker results.
Note that one or more x and/or y coordinates may not be generated in the
`BoundingPoly` (the polygon will be unbounded) if only a partial face
appears in the image to be annotated.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `https://docs.cloud.google.com/php/docs/reference/cloud-vision/latest/V1.BoundingPoly` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `$this` |   |

### getFdBoundingPoly

The `fd_bounding_poly` bounding polygon is tighter than the
`boundingPoly`, and encloses only the skin part of the face. Typically, it
is used to eliminate the face from any image analysis that detects the
"amount of skin" visible in an image. It is not based on the
landmarker results, only on the initial face detection, hence
the `fd` (face detection) prefix.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/php/docs/reference/cloud-vision/latest/V1.BoundingPoly|null` |   |

### hasFdBoundingPoly

### clearFdBoundingPoly

### setFdBoundingPoly

The `fd_bounding_poly` bounding polygon is tighter than the
`boundingPoly`, and encloses only the skin part of the face. Typically, it
is used to eliminate the face from any image analysis that detects the
"amount of skin" visible in an image. It is not based on the
landmarker results, only on the initial face detection, hence
the `fd` (face detection) prefix.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `https://docs.cloud.google.com/php/docs/reference/cloud-vision/latest/V1.BoundingPoly` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `$this` |   |

### getLandmarks

Detected face landmarks.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://protobuf.dev/reference/php/api-docs/Google/Protobuf/RepeatedField<https://docs.cloud.google.com/php/docs/reference/cloud-vision/latest/V1.FaceAnnotation.Landmark>` |   |

### setLandmarks

Detected face landmarks.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `array<https://docs.cloud.google.com/php/docs/reference/cloud-vision/latest/V1.FaceAnnotation.Landmark>` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `$this` |   |

### getRollAngle

Roll angle, which indicates the amount of clockwise/anti-clockwise rotation
of the face relative to the image vertical about the axis perpendicular to
the face. Range \[-180,180\].

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `float` |   |

### setRollAngle

Roll angle, which indicates the amount of clockwise/anti-clockwise rotation
of the face relative to the image vertical about the axis perpendicular to
the face. Range \[-180,180\].

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `float` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `$this` |   |

### getPanAngle

Yaw angle, which indicates the leftward/rightward angle that the face is
pointing relative to the vertical plane perpendicular to the image. Range
\[-180,180\].

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `float` |   |

### setPanAngle

Yaw angle, which indicates the leftward/rightward angle that the face is
pointing relative to the vertical plane perpendicular to the image. Range
\[-180,180\].

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `float` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `$this` |   |

### getTiltAngle

Pitch angle, which indicates the upwards/downwards angle that the face is
pointing relative to the image's horizontal plane. Range \[-180,180\].

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `float` |   |

### setTiltAngle

Pitch angle, which indicates the upwards/downwards angle that the face is
pointing relative to the image's horizontal plane. Range \[-180,180\].

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `float` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `$this` |   |

### getDetectionConfidence

Detection confidence. Range \[0, 1\].

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `float` |   |

### setDetectionConfidence

Detection confidence. Range \[0, 1\].

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `float` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `$this` |   |

### getLandmarkingConfidence

Face landmarking confidence. Range \[0, 1\].

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `float` |   |

### setLandmarkingConfidence

Face landmarking confidence. Range \[0, 1\].

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `float` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `$this` |   |

### getJoyLikelihood

Joy likelihood.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `int` | Enum of type [Likelihood](https://docs.cloud.google.com/php/docs/reference/cloud-vision/latest/V1.Likelihood). |

### setJoyLikelihood

Joy likelihood.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `int` Enum of type [Likelihood](https://docs.cloud.google.com/php/docs/reference/cloud-vision/latest/V1.Likelihood). |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `$this` |   |

### getSorrowLikelihood

Sorrow likelihood.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `int` | Enum of type [Likelihood](https://docs.cloud.google.com/php/docs/reference/cloud-vision/latest/V1.Likelihood). |

### setSorrowLikelihood

Sorrow likelihood.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `int` Enum of type [Likelihood](https://docs.cloud.google.com/php/docs/reference/cloud-vision/latest/V1.Likelihood). |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `$this` |   |

### getAngerLikelihood

Anger likelihood.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `int` | Enum of type [Likelihood](https://docs.cloud.google.com/php/docs/reference/cloud-vision/latest/V1.Likelihood). |

### setAngerLikelihood

Anger likelihood.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `int` Enum of type [Likelihood](https://docs.cloud.google.com/php/docs/reference/cloud-vision/latest/V1.Likelihood). |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `$this` |   |

### getSurpriseLikelihood

Surprise likelihood.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `int` | Enum of type [Likelihood](https://docs.cloud.google.com/php/docs/reference/cloud-vision/latest/V1.Likelihood). |

### setSurpriseLikelihood

Surprise likelihood.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `int` Enum of type [Likelihood](https://docs.cloud.google.com/php/docs/reference/cloud-vision/latest/V1.Likelihood). |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `$this` |   |

### getUnderExposedLikelihood

Under-exposed likelihood.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `int` | Enum of type [Likelihood](https://docs.cloud.google.com/php/docs/reference/cloud-vision/latest/V1.Likelihood). |

### setUnderExposedLikelihood

Under-exposed likelihood.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `int` Enum of type [Likelihood](https://docs.cloud.google.com/php/docs/reference/cloud-vision/latest/V1.Likelihood). |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `$this` |   |

### getBlurredLikelihood

Blurred likelihood.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `int` | Enum of type [Likelihood](https://docs.cloud.google.com/php/docs/reference/cloud-vision/latest/V1.Likelihood). |

### setBlurredLikelihood

Blurred likelihood.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `int` Enum of type [Likelihood](https://docs.cloud.google.com/php/docs/reference/cloud-vision/latest/V1.Likelihood). |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `$this` |   |

### getHeadwearLikelihood

Headwear likelihood.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `int` | Enum of type [Likelihood](https://docs.cloud.google.com/php/docs/reference/cloud-vision/latest/V1.Likelihood). |

### setHeadwearLikelihood

Headwear likelihood.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `int` Enum of type [Likelihood](https://docs.cloud.google.com/php/docs/reference/cloud-vision/latest/V1.Likelihood). |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `$this` |   |