# Cloud Video Intelligence V1 Client - Class TextAnnotation (2.2.0)

2.2.0 (latest) 2.1.2 2.0.5 1.15.5 1.14.2 1.13.1 1.12.16 Reference documentation and code samples for the Cloud Video Intelligence V1 Client class TextAnnotation.

Annotations related to one detected OCR text snippet. This will contain the
corresponding text, confidence value, and frame level information for each
detection.

Generated from protobuf message `google.cloud.videointelligence.v1.TextAnnotation`

## Namespace

Google \\ Cloud \\ VideoIntelligence \\ V1

## Methods

### __construct

Constructor.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `data` | `array` Optional. Data for populating the Message object. |
| `↳ text` | `string` The detected text. |
| `↳ segments` | `array<https://docs.cloud.google.com/php/docs/reference/cloud-videointelligence/latest/V1.TextSegment>` All video segments where OCR detected text appears. |
| `↳ version` | `string` Feature version. |

### getText

The detected text.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `string` |   |

### setText

The detected text.

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

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

### getSegments

All video segments where OCR detected text appears.

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

### setSegments

All video segments where OCR detected text appears.

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

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

### getVersion

Feature version.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `string` |   |

### setVersion

Feature version.

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

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