# Cloud Video Intelligence V1 Client - Class TextSegment (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 TextSegment.

Video segment level annotation results for text detection.

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

## Namespace

Google \\ Cloud \\ VideoIntelligence \\ V1

## Methods

### __construct

Constructor.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `data` | `array` Optional. Data for populating the Message object. |
| `↳ segment` | `https://docs.cloud.google.com/php/docs/reference/cloud-videointelligence/latest/V1.VideoSegment` Video segment where a text snippet was detected. |
| `↳ confidence` | `float` Confidence for the track of detected text. It is calculated as the highest over all frames where OCR detected text appears. |
| `↳ frames` | `array<https://docs.cloud.google.com/php/docs/reference/cloud-videointelligence/latest/V1.TextFrame>` Information related to the frames where OCR detected text appears. |

### getSegment

Video segment where a text snippet was detected.

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

### hasSegment

### clearSegment

### setSegment

Video segment where a text snippet was detected.

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

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

### getConfidence

Confidence for the track of detected text. It is calculated as the highest
over all frames where OCR detected text appears.

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

### setConfidence

Confidence for the track of detected text. It is calculated as the highest
over all frames where OCR detected text appears.

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

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

### getFrames

Information related to the frames 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.TextFrame>` |   |

### setFrames

Information related to the frames where OCR detected text appears.

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

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