Class ReferenceImage (3.26.0)

publicfinalclass ReferenceImageextendsGeneratedMessageV3implementsReferenceImageOrBuilder

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

Protobuf type google.cloud.vision.v1.ReferenceImage

Inherited Members

com.google.protobuf.GeneratedMessageV3.<ListT>makeMutableCopy(ListT)
com.google.protobuf.GeneratedMessageV3.<ListT>makeMutableCopy(ListT,int)
com.google.protobuf.GeneratedMessageV3.<T>emptyList(java.lang.Class<T>)

Static Fields

BOUNDING_POLYS_FIELD_NUMBER

publicstaticfinalintBOUNDING_POLYS_FIELD_NUMBER
Field Value
Type Description
int

NAME_FIELD_NUMBER

publicstaticfinalintNAME_FIELD_NUMBER
Field Value
Type Description
int

URI_FIELD_NUMBER

publicstaticfinalintURI_FIELD_NUMBER
Field Value
Type Description
int

Static Methods

getDefaultInstance()

publicstaticReferenceImagegetDefaultInstance()
Returns
Type Description
ReferenceImage

getDescriptor()

publicstaticfinalDescriptors.DescriptorgetDescriptor()
Returns
Type Description
Descriptor

newBuilder()

publicstaticReferenceImage.BuildernewBuilder()
Returns
Type Description
ReferenceImage.Builder

newBuilder(ReferenceImage prototype)

publicstaticReferenceImage.BuildernewBuilder(ReferenceImageprototype)
Parameter
Name Description
prototype ReferenceImage
Returns
Type Description
ReferenceImage.Builder

parseDelimitedFrom(InputStream input)

publicstaticReferenceImageparseDelimitedFrom(InputStreaminput)
Parameter
Name Description
input InputStream
Returns
Type Description
ReferenceImage
Exceptions
Type Description
IOException

parseDelimitedFrom(InputStream input, ExtensionRegistryLite extensionRegistry)

publicstaticReferenceImageparseDelimitedFrom(InputStreaminput,ExtensionRegistryLiteextensionRegistry)
Parameters
Name Description
input InputStream
extensionRegistry ExtensionRegistryLite
Returns
Type Description
ReferenceImage
Exceptions
Type Description
IOException

parseFrom(byte[] data)

publicstaticReferenceImageparseFrom(byte[]data)
Parameter
Name Description
data byte[]
Returns
Type Description
ReferenceImage
Exceptions
Type Description
InvalidProtocolBufferException

parseFrom(byte[] data, ExtensionRegistryLite extensionRegistry)

publicstaticReferenceImageparseFrom(byte[]data,ExtensionRegistryLiteextensionRegistry)
Parameters
Name Description
data byte[]
extensionRegistry ExtensionRegistryLite
Returns
Type Description
ReferenceImage
Exceptions
Type Description
InvalidProtocolBufferException

parseFrom(ByteString data)

publicstaticReferenceImageparseFrom(ByteStringdata)
Parameter
Name Description
data ByteString
Returns
Type Description
ReferenceImage
Exceptions
Type Description
InvalidProtocolBufferException

parseFrom(ByteString data, ExtensionRegistryLite extensionRegistry)

publicstaticReferenceImageparseFrom(ByteStringdata,ExtensionRegistryLiteextensionRegistry)
Parameters
Name Description
data ByteString
extensionRegistry ExtensionRegistryLite
Returns
Type Description
ReferenceImage
Exceptions
Type Description
InvalidProtocolBufferException

parseFrom(CodedInputStream input)

publicstaticReferenceImageparseFrom(CodedInputStreaminput)
Parameter
Name Description
input CodedInputStream
Returns
Type Description
ReferenceImage
Exceptions
Type Description
IOException

parseFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)

publicstaticReferenceImageparseFrom(CodedInputStreaminput,ExtensionRegistryLiteextensionRegistry)
Parameters
Name Description
input CodedInputStream
extensionRegistry ExtensionRegistryLite
Returns
Type Description
ReferenceImage
Exceptions
Type Description
IOException

parseFrom(InputStream input)

publicstaticReferenceImageparseFrom(InputStreaminput)
Parameter
Name Description
input InputStream
Returns
Type Description
ReferenceImage
Exceptions
Type Description
IOException

parseFrom(InputStream input, ExtensionRegistryLite extensionRegistry)

publicstaticReferenceImageparseFrom(InputStreaminput,ExtensionRegistryLiteextensionRegistry)
Parameters
Name Description
input InputStream
extensionRegistry ExtensionRegistryLite
Returns
Type Description
ReferenceImage
Exceptions
Type Description
IOException

parseFrom(ByteBuffer data)

publicstaticReferenceImageparseFrom(ByteBufferdata)
Parameter
Name Description
data ByteBuffer
Returns
Type Description
ReferenceImage
Exceptions
Type Description
InvalidProtocolBufferException

parseFrom(ByteBuffer data, ExtensionRegistryLite extensionRegistry)

publicstaticReferenceImageparseFrom(ByteBufferdata,ExtensionRegistryLiteextensionRegistry)
Parameters
Name Description
data ByteBuffer
extensionRegistry ExtensionRegistryLite
Returns
Type Description
ReferenceImage
Exceptions
Type Description
InvalidProtocolBufferException

parser()

publicstaticParser<ReferenceImage>parser()
Returns
Type Description
Parser<ReferenceImage>

Methods

equals(Object obj)

publicbooleanequals(Objectobj)
Parameter
Name Description
obj Object
Returns
Type Description
boolean
Overrides

getBoundingPolys(int index)

publicBoundingPolygetBoundingPolys(intindex)

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).

repeated .google.cloud.vision.v1.BoundingPoly bounding_polys = 3 [(.google.api.field_behavior) = OPTIONAL];

Parameter
Name Description
index int
Returns
Type Description
BoundingPoly

getBoundingPolysCount()

publicintgetBoundingPolysCount()

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).

repeated .google.cloud.vision.v1.BoundingPoly bounding_polys = 3 [(.google.api.field_behavior) = OPTIONAL];

Returns
Type Description
int

getBoundingPolysList()

publicList<BoundingPoly>getBoundingPolysList()

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).

repeated .google.cloud.vision.v1.BoundingPoly bounding_polys = 3 [(.google.api.field_behavior) = OPTIONAL];

Returns
Type Description
List<BoundingPoly>

getBoundingPolysOrBuilder(int index)

publicBoundingPolyOrBuildergetBoundingPolysOrBuilder(intindex)

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).

repeated .google.cloud.vision.v1.BoundingPoly bounding_polys = 3 [(.google.api.field_behavior) = OPTIONAL];

Parameter
Name Description
index int
Returns
Type Description
BoundingPolyOrBuilder

getBoundingPolysOrBuilderList()

publicList<?extendsBoundingPolyOrBuilder>getBoundingPolysOrBuilderList()

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).

repeated .google.cloud.vision.v1.BoundingPoly bounding_polys = 3 [(.google.api.field_behavior) = OPTIONAL];

Returns
Type Description
List<? extends com.google.cloud.vision.v1.BoundingPolyOrBuilder>

getDefaultInstanceForType()

publicReferenceImagegetDefaultInstanceForType()
Returns
Type Description
ReferenceImage

getName()

publicStringgetName()

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.

string name = 1;

Returns
Type Description
String

The name.

getNameBytes()

publicByteStringgetNameBytes()

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.

string name = 1;

Returns
Type Description
ByteString

The bytes for name.

getParserForType()

publicParser<ReferenceImage>getParserForType()
Returns
Type Description
Parser<ReferenceImage>
Overrides

getSerializedSize()

publicintgetSerializedSize()
Returns
Type Description
int
Overrides

getUri()

publicStringgetUri()

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

The URI must start with gs://.

string uri = 2 [(.google.api.field_behavior) = REQUIRED];

Returns
Type Description
String

The uri.

getUriBytes()

publicByteStringgetUriBytes()

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

The URI must start with gs://.

string uri = 2 [(.google.api.field_behavior) = REQUIRED];

Returns
Type Description
ByteString

The bytes for uri.

hashCode()

publicinthashCode()
Returns
Type Description
int
Overrides

internalGetFieldAccessorTable()

protectedGeneratedMessageV3.FieldAccessorTableinternalGetFieldAccessorTable()
Returns
Type Description
FieldAccessorTable
Overrides

isInitialized()

publicfinalbooleanisInitialized()
Returns
Type Description
boolean
Overrides

newBuilderForType()

publicReferenceImage.BuildernewBuilderForType()
Returns
Type Description
ReferenceImage.Builder

newBuilderForType(GeneratedMessageV3.BuilderParent parent)

protectedReferenceImage.BuildernewBuilderForType(GeneratedMessageV3.BuilderParentparent)
Parameter
Name Description
parent BuilderParent
Returns
Type Description
ReferenceImage.Builder
Overrides

newInstance(GeneratedMessageV3.UnusedPrivateParameter unused)

protectedObjectnewInstance(GeneratedMessageV3.UnusedPrivateParameterunused)
Parameter
Name Description
unused UnusedPrivateParameter
Returns
Type Description
Object
Overrides

toBuilder()

publicReferenceImage.BuildertoBuilder()
Returns
Type Description
ReferenceImage.Builder

writeTo(CodedOutputStream output)

publicvoidwriteTo(CodedOutputStreamoutput)
Parameter
Name Description
output CodedOutputStream
Overrides
Exceptions
Type Description
IOException

Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.

Last updated 2025年11月19日 UTC.