Class ImageContext (3.53.0)

public final class ImageContext extends GeneratedMessageV3 implements ImageContextOrBuilder

Image context and/or feature-specific parameters.

Protobuf type google.cloud.vision.v1p1beta1.ImageContext

Static Fields

CROP_HINTS_PARAMS_FIELD_NUMBER

public static final int CROP_HINTS_PARAMS_FIELD_NUMBER
Field Value
Type Description
int

LANGUAGE_HINTS_FIELD_NUMBER

public static final int LANGUAGE_HINTS_FIELD_NUMBER
Field Value
Type Description
int

LAT_LONG_RECT_FIELD_NUMBER

public static final int LAT_LONG_RECT_FIELD_NUMBER
Field Value
Type Description
int

TEXT_DETECTION_PARAMS_FIELD_NUMBER

public static final int TEXT_DETECTION_PARAMS_FIELD_NUMBER
Field Value
Type Description
int

WEB_DETECTION_PARAMS_FIELD_NUMBER

public static final int WEB_DETECTION_PARAMS_FIELD_NUMBER
Field Value
Type Description
int

Static Methods

getDefaultInstance()

public static ImageContext getDefaultInstance()
Returns
Type Description
ImageContext

getDescriptor()

public static final Descriptors.Descriptor getDescriptor()
Returns
Type Description
Descriptor

newBuilder()

public static ImageContext.Builder newBuilder()
Returns
Type Description
ImageContext.Builder

newBuilder(ImageContext prototype)

public static ImageContext.Builder newBuilder(ImageContext prototype)
Parameter
Name Description
prototype ImageContext
Returns
Type Description
ImageContext.Builder

parseDelimitedFrom(InputStream input)

public static ImageContext parseDelimitedFrom(InputStream input)
Parameter
Name Description
input InputStream
Returns
Type Description
ImageContext
Exceptions
Type Description
IOException

parseDelimitedFrom(InputStream input, ExtensionRegistryLite extensionRegistry)

public static ImageContext parseDelimitedFrom(InputStream input, ExtensionRegistryLite extensionRegistry)
Parameters
Name Description
input InputStream
extensionRegistry ExtensionRegistryLite
Returns
Type Description
ImageContext
Exceptions
Type Description
IOException

parseFrom(byte[] data)

public static ImageContext parseFrom(byte[] data)
Parameter
Name Description
data byte[]
Returns
Type Description
ImageContext
Exceptions
Type Description
InvalidProtocolBufferException

parseFrom(byte[] data, ExtensionRegistryLite extensionRegistry)

public static ImageContext parseFrom(byte[] data, ExtensionRegistryLite extensionRegistry)
Parameters
Name Description
data byte[]
extensionRegistry ExtensionRegistryLite
Returns
Type Description
ImageContext
Exceptions
Type Description
InvalidProtocolBufferException

parseFrom(ByteString data)

public static ImageContext parseFrom(ByteString data)
Parameter
Name Description
data ByteString
Returns
Type Description
ImageContext
Exceptions
Type Description
InvalidProtocolBufferException

parseFrom(ByteString data, ExtensionRegistryLite extensionRegistry)

public static ImageContext parseFrom(ByteString data, ExtensionRegistryLite extensionRegistry)
Parameters
Name Description
data ByteString
extensionRegistry ExtensionRegistryLite
Returns
Type Description
ImageContext
Exceptions
Type Description
InvalidProtocolBufferException

parseFrom(CodedInputStream input)

public static ImageContext parseFrom(CodedInputStream input)
Parameter
Name Description
input CodedInputStream
Returns
Type Description
ImageContext
Exceptions
Type Description
IOException

parseFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)

public static ImageContext parseFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)
Parameters
Name Description
input CodedInputStream
extensionRegistry ExtensionRegistryLite
Returns
Type Description
ImageContext
Exceptions
Type Description
IOException

parseFrom(InputStream input)

public static ImageContext parseFrom(InputStream input)
Parameter
Name Description
input InputStream
Returns
Type Description
ImageContext
Exceptions
Type Description
IOException

parseFrom(InputStream input, ExtensionRegistryLite extensionRegistry)

public static ImageContext parseFrom(InputStream input, ExtensionRegistryLite extensionRegistry)
Parameters
Name Description
input InputStream
extensionRegistry ExtensionRegistryLite
Returns
Type Description
ImageContext
Exceptions
Type Description
IOException

parseFrom(ByteBuffer data)

public static ImageContext parseFrom(ByteBuffer data)
Parameter
Name Description
data ByteBuffer
Returns
Type Description
ImageContext
Exceptions
Type Description
InvalidProtocolBufferException

parseFrom(ByteBuffer data, ExtensionRegistryLite extensionRegistry)

public static ImageContext parseFrom(ByteBuffer data, ExtensionRegistryLite extensionRegistry)
Parameters
Name Description
data ByteBuffer
extensionRegistry ExtensionRegistryLite
Returns
Type Description
ImageContext
Exceptions
Type Description
InvalidProtocolBufferException

parser()

public static Parser<ImageContext> parser()
Returns
Type Description
Parser<ImageContext>

Methods

equals(Object obj)

public boolean equals(Object obj)
Parameter
Name Description
obj Object
Returns
Type Description
boolean
Overrides

getCropHintsParams()

public CropHintsParams getCropHintsParams()

Parameters for crop hints annotation request.

.google.cloud.vision.v1p1beta1.CropHintsParams crop_hints_params = 4;

Returns
Type Description
CropHintsParams

The cropHintsParams.

getCropHintsParamsOrBuilder()

public CropHintsParamsOrBuilder getCropHintsParamsOrBuilder()

Parameters for crop hints annotation request.

.google.cloud.vision.v1p1beta1.CropHintsParams crop_hints_params = 4;

Returns
Type Description
CropHintsParamsOrBuilder

getDefaultInstanceForType()

public ImageContext getDefaultInstanceForType()
Returns
Type Description
ImageContext

getLanguageHints(int index)

public String getLanguageHints(int index)

List of languages to use for TEXT_DETECTION. In most cases, an empty value yields the best results since it enables automatic language detection. For languages based on the Latin alphabet, setting language_hints is not needed. In rare cases, when the language of the text in the image is known, setting a hint will help get better results (although it will be a significant hindrance if the hint is wrong). Text detection returns an error if one or more of the specified languages is not one of the supported languages.

repeated string language_hints = 2;

Parameter
Name Description
index int

The index of the element to return.

Returns
Type Description
String

The languageHints at the given index.

getLanguageHintsBytes(int index)

public ByteString getLanguageHintsBytes(int index)

List of languages to use for TEXT_DETECTION. In most cases, an empty value yields the best results since it enables automatic language detection. For languages based on the Latin alphabet, setting language_hints is not needed. In rare cases, when the language of the text in the image is known, setting a hint will help get better results (although it will be a significant hindrance if the hint is wrong). Text detection returns an error if one or more of the specified languages is not one of the supported languages.

repeated string language_hints = 2;

Parameter
Name Description
index int

The index of the value to return.

Returns
Type Description
ByteString

The bytes of the languageHints at the given index.

getLanguageHintsCount()

public int getLanguageHintsCount()

List of languages to use for TEXT_DETECTION. In most cases, an empty value yields the best results since it enables automatic language detection. For languages based on the Latin alphabet, setting language_hints is not needed. In rare cases, when the language of the text in the image is known, setting a hint will help get better results (although it will be a significant hindrance if the hint is wrong). Text detection returns an error if one or more of the specified languages is not one of the supported languages.

repeated string language_hints = 2;

Returns
Type Description
int

The count of languageHints.

getLanguageHintsList()

public ProtocolStringList getLanguageHintsList()

List of languages to use for TEXT_DETECTION. In most cases, an empty value yields the best results since it enables automatic language detection. For languages based on the Latin alphabet, setting language_hints is not needed. In rare cases, when the language of the text in the image is known, setting a hint will help get better results (although it will be a significant hindrance if the hint is wrong). Text detection returns an error if one or more of the specified languages is not one of the supported languages.

repeated string language_hints = 2;

Returns
Type Description
ProtocolStringList

A list containing the languageHints.

getLatLongRect()

public LatLongRect getLatLongRect()

lat/long rectangle that specifies the location of the image.

.google.cloud.vision.v1p1beta1.LatLongRect lat_long_rect = 1;

Returns
Type Description
LatLongRect

The latLongRect.

getLatLongRectOrBuilder()

public LatLongRectOrBuilder getLatLongRectOrBuilder()

lat/long rectangle that specifies the location of the image.

.google.cloud.vision.v1p1beta1.LatLongRect lat_long_rect = 1;

Returns
Type Description
LatLongRectOrBuilder

getParserForType()

public Parser<ImageContext> getParserForType()
Returns
Type Description
Parser<ImageContext>
Overrides

getSerializedSize()

public int getSerializedSize()
Returns
Type Description
int
Overrides

getTextDetectionParams()

public TextDetectionParams getTextDetectionParams()

Parameters for text detection and document text detection.

.google.cloud.vision.v1p1beta1.TextDetectionParams text_detection_params = 12;

Returns
Type Description
TextDetectionParams

The textDetectionParams.

getTextDetectionParamsOrBuilder()

public TextDetectionParamsOrBuilder getTextDetectionParamsOrBuilder()

Parameters for text detection and document text detection.

.google.cloud.vision.v1p1beta1.TextDetectionParams text_detection_params = 12;

Returns
Type Description
TextDetectionParamsOrBuilder

getWebDetectionParams()

public WebDetectionParams getWebDetectionParams()

Parameters for web detection.

.google.cloud.vision.v1p1beta1.WebDetectionParams web_detection_params = 6;

Returns
Type Description
WebDetectionParams

The webDetectionParams.

getWebDetectionParamsOrBuilder()

public WebDetectionParamsOrBuilder getWebDetectionParamsOrBuilder()

Parameters for web detection.

.google.cloud.vision.v1p1beta1.WebDetectionParams web_detection_params = 6;

Returns
Type Description
WebDetectionParamsOrBuilder

hasCropHintsParams()

public boolean hasCropHintsParams()

Parameters for crop hints annotation request.

.google.cloud.vision.v1p1beta1.CropHintsParams crop_hints_params = 4;

Returns
Type Description
boolean

Whether the cropHintsParams field is set.

hasLatLongRect()

public boolean hasLatLongRect()

lat/long rectangle that specifies the location of the image.

.google.cloud.vision.v1p1beta1.LatLongRect lat_long_rect = 1;

Returns
Type Description
boolean

Whether the latLongRect field is set.

hasTextDetectionParams()

public boolean hasTextDetectionParams()

Parameters for text detection and document text detection.

.google.cloud.vision.v1p1beta1.TextDetectionParams text_detection_params = 12;

Returns
Type Description
boolean

Whether the textDetectionParams field is set.

hasWebDetectionParams()

public boolean hasWebDetectionParams()

Parameters for web detection.

.google.cloud.vision.v1p1beta1.WebDetectionParams web_detection_params = 6;

Returns
Type Description
boolean

Whether the webDetectionParams field is set.

hashCode()

public int hashCode()
Returns
Type Description
int
Overrides

internalGetFieldAccessorTable()

protected GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable()
Returns
Type Description
FieldAccessorTable
Overrides

isInitialized()

public final boolean isInitialized()
Returns
Type Description
boolean
Overrides

newBuilderForType()

public ImageContext.Builder newBuilderForType()
Returns
Type Description
ImageContext.Builder

newBuilderForType(GeneratedMessageV3.BuilderParent parent)

protected ImageContext.Builder newBuilderForType(GeneratedMessageV3.BuilderParent parent)
Parameter
Name Description
parent BuilderParent
Returns
Type Description
ImageContext.Builder
Overrides

newInstance(GeneratedMessageV3.UnusedPrivateParameter unused)

protected Object newInstance(GeneratedMessageV3.UnusedPrivateParameter unused)
Parameter
Name Description
unused UnusedPrivateParameter
Returns
Type Description
Object
Overrides

toBuilder()

public ImageContext.Builder toBuilder()
Returns
Type Description
ImageContext.Builder

writeTo(CodedOutputStream output)

public void writeTo(CodedOutputStream output)
Parameter
Name Description
output CodedOutputStream
Overrides
Exceptions
Type Description
IOException