# Cloud Vision V1 Client - Class ReferenceImage (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 ReferenceImage.

A `ReferenceImage` represents a product image and its associated metadata,
such as bounding boxes.

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

## Namespace

Google \\ Cloud \\ Vision \\ V1

## Methods

### __construct

Constructor.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `data` | `array` Optional. Data for populating the Message object. |
| `↳ name` | `string` The resource name of the reference image. Format is: `projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID/referenceImages/IMAGE_ID`. This field is ignored when creating a reference image. |
| `↳ uri` | `string` Required. The Google Cloud Storage URI of the reference image. The URI must start with `gs://`. |
| `↳ bounding_polys` | `array<https://docs.cloud.google.com/php/docs/reference/cloud-vision/latest/V1.BoundingPoly>` Optional. Bounding polygons around the areas of interest in the reference image. If this field is empty, the system will try to detect regions of interest. At most 10 bounding polygons will be used. The provided shape is converted into a non-rotated rectangle. Once converted, the small edge of the rectangle must be greater than or equal to 300 pixels. The aspect ratio must be 1:4 or less (i.e. 1:3 is ok; 1:5 is not). |

### getName

The resource name of the reference image.

Format is:
`projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID/referenceImages/IMAGE_ID`.
This field is ignored when creating a reference image.

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

### setName

The resource name of the reference image.

Format is:
`projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID/referenceImages/IMAGE_ID`.
This field is ignored when creating a reference image.

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

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

### getUri

Required. The Google Cloud Storage URI of the reference image.

The URI must start with `gs://`.

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

### setUri

Required. The Google Cloud Storage URI of the reference image.

The URI must start with `gs://`.

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

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

### getBoundingPolys

Optional. Bounding polygons around the areas of interest in the reference
image. If this field is empty, the system will try to detect regions of
interest. At most 10 bounding polygons will be used.

The provided shape is converted into a non-rotated rectangle. Once
converted, the small edge of the rectangle must be greater than or equal
to 300 pixels. The aspect ratio must be 1:4 or less (i.e. 1:3 is ok; 1:5
is not).

| **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.BoundingPoly>` |   |

### setBoundingPolys

Optional. Bounding polygons around the areas of interest in the reference
image. If this field is empty, the system will try to detect regions of
interest. At most 10 bounding polygons will be used.

The provided shape is converted into a non-rotated rectangle. Once
converted, the small edge of the rectangle must be greater than or equal
to 300 pixels. The aspect ratio must be 1:4 or less (i.e. 1:3 is ok; 1:5
is not).

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

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