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

Methods

__construct

Constructor.

Parameters
NameDescription
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<Google\Cloud\Vision\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
TypeDescription
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
NameDescription
var string
Returns
TypeDescription
$this

getUri

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

The URI must start with gs://.

Returns
TypeDescription
string

setUri

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

The URI must start with gs://.

Parameter
NameDescription
var string
Returns
TypeDescription
$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
TypeDescription
Google\Protobuf\Internal\RepeatedField

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
NameDescription
var array<Google\Cloud\Vision\V1\BoundingPoly>
Returns
TypeDescription
$this