Class TextDetectionParams.Builder (3.81.0)

public static final class TextDetectionParams.Builder extends GeneratedMessage.Builder<TextDetectionParams.Builder> implements TextDetectionParamsOrBuilder

Parameters for text detections. This is used to control TEXT_DETECTION and DOCUMENT_TEXT_DETECTION features.

Protobuf type google.cloud.vision.v1.TextDetectionParams

Static Methods

getDescriptor()

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

Methods

addAdvancedOcrOptions(String value)

public TextDetectionParams.Builder addAdvancedOcrOptions(String value)

A list of advanced OCR options to further fine-tune OCR behavior. Current valid values are:

  • legacy_layout: a heuristics layout detection algorithm, which serves as an alternative to the current ML-based layout detection algorithm. Customers can choose the best suitable layout algorithm based on their situation.

repeated string advanced_ocr_options = 11;

Parameter
Name Description
value String

The advancedOcrOptions to add.

Returns
Type Description
TextDetectionParams.Builder

This builder for chaining.

addAdvancedOcrOptionsBytes(ByteString value)

public TextDetectionParams.Builder addAdvancedOcrOptionsBytes(ByteString value)

A list of advanced OCR options to further fine-tune OCR behavior. Current valid values are:

  • legacy_layout: a heuristics layout detection algorithm, which serves as an alternative to the current ML-based layout detection algorithm. Customers can choose the best suitable layout algorithm based on their situation.

repeated string advanced_ocr_options = 11;

Parameter
Name Description
value ByteString

The bytes of the advancedOcrOptions to add.

Returns
Type Description
TextDetectionParams.Builder

This builder for chaining.

addAllAdvancedOcrOptions(Iterable<String> values)

public TextDetectionParams.Builder addAllAdvancedOcrOptions(Iterable<String> values)

A list of advanced OCR options to further fine-tune OCR behavior. Current valid values are:

  • legacy_layout: a heuristics layout detection algorithm, which serves as an alternative to the current ML-based layout detection algorithm. Customers can choose the best suitable layout algorithm based on their situation.

repeated string advanced_ocr_options = 11;

Parameter
Name Description
values Iterable<String>

The advancedOcrOptions to add.

Returns
Type Description
TextDetectionParams.Builder

This builder for chaining.

build()

public TextDetectionParams build()
Returns
Type Description
TextDetectionParams

buildPartial()

public TextDetectionParams buildPartial()
Returns
Type Description
TextDetectionParams

clear()

public TextDetectionParams.Builder clear()
Returns
Type Description
TextDetectionParams.Builder
Overrides

clearAdvancedOcrOptions()

public TextDetectionParams.Builder clearAdvancedOcrOptions()

A list of advanced OCR options to further fine-tune OCR behavior. Current valid values are:

  • legacy_layout: a heuristics layout detection algorithm, which serves as an alternative to the current ML-based layout detection algorithm. Customers can choose the best suitable layout algorithm based on their situation.

repeated string advanced_ocr_options = 11;

Returns
Type Description
TextDetectionParams.Builder

This builder for chaining.

clearEnableTextDetectionConfidenceScore()

public TextDetectionParams.Builder clearEnableTextDetectionConfidenceScore()

By default, Cloud Vision API only includes confidence score for DOCUMENT_TEXT_DETECTION result. Set the flag to true to include confidence score for TEXT_DETECTION as well.

bool enable_text_detection_confidence_score = 9;

Returns
Type Description
TextDetectionParams.Builder

This builder for chaining.

getAdvancedOcrOptions(int index)

public String getAdvancedOcrOptions(int index)

A list of advanced OCR options to further fine-tune OCR behavior. Current valid values are:

  • legacy_layout: a heuristics layout detection algorithm, which serves as an alternative to the current ML-based layout detection algorithm. Customers can choose the best suitable layout algorithm based on their situation.

repeated string advanced_ocr_options = 11;

Parameter
Name Description
index int

The index of the element to return.

Returns
Type Description
String

The advancedOcrOptions at the given index.

getAdvancedOcrOptionsBytes(int index)

public ByteString getAdvancedOcrOptionsBytes(int index)

A list of advanced OCR options to further fine-tune OCR behavior. Current valid values are:

  • legacy_layout: a heuristics layout detection algorithm, which serves as an alternative to the current ML-based layout detection algorithm. Customers can choose the best suitable layout algorithm based on their situation.

repeated string advanced_ocr_options = 11;

Parameter
Name Description
index int

The index of the value to return.

Returns
Type Description
ByteString

The bytes of the advancedOcrOptions at the given index.

getAdvancedOcrOptionsCount()

public int getAdvancedOcrOptionsCount()

A list of advanced OCR options to further fine-tune OCR behavior. Current valid values are:

  • legacy_layout: a heuristics layout detection algorithm, which serves as an alternative to the current ML-based layout detection algorithm. Customers can choose the best suitable layout algorithm based on their situation.

repeated string advanced_ocr_options = 11;

Returns
Type Description
int

The count of advancedOcrOptions.

getAdvancedOcrOptionsList()

public ProtocolStringList getAdvancedOcrOptionsList()

A list of advanced OCR options to further fine-tune OCR behavior. Current valid values are:

  • legacy_layout: a heuristics layout detection algorithm, which serves as an alternative to the current ML-based layout detection algorithm. Customers can choose the best suitable layout algorithm based on their situation.

repeated string advanced_ocr_options = 11;

Returns
Type Description
ProtocolStringList

A list containing the advancedOcrOptions.

getDefaultInstanceForType()

public TextDetectionParams getDefaultInstanceForType()
Returns
Type Description
TextDetectionParams

getDescriptorForType()

public Descriptors.Descriptor getDescriptorForType()
Returns
Type Description
Descriptor
Overrides

getEnableTextDetectionConfidenceScore()

public boolean getEnableTextDetectionConfidenceScore()

By default, Cloud Vision API only includes confidence score for DOCUMENT_TEXT_DETECTION result. Set the flag to true to include confidence score for TEXT_DETECTION as well.

bool enable_text_detection_confidence_score = 9;

Returns
Type Description
boolean

The enableTextDetectionConfidenceScore.

internalGetFieldAccessorTable()

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

isInitialized()

public final boolean isInitialized()
Returns
Type Description
boolean
Overrides

mergeFrom(TextDetectionParams other)

public TextDetectionParams.Builder mergeFrom(TextDetectionParams other)
Parameter
Name Description
other TextDetectionParams
Returns
Type Description
TextDetectionParams.Builder

mergeFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)

public TextDetectionParams.Builder mergeFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)
Parameters
Name Description
input CodedInputStream
extensionRegistry ExtensionRegistryLite
Returns
Type Description
TextDetectionParams.Builder
Overrides
Exceptions
Type Description
IOException

mergeFrom(Message other)

public TextDetectionParams.Builder mergeFrom(Message other)
Parameter
Name Description
other Message
Returns
Type Description
TextDetectionParams.Builder
Overrides

setAdvancedOcrOptions(int index, String value)

public TextDetectionParams.Builder setAdvancedOcrOptions(int index, String value)

A list of advanced OCR options to further fine-tune OCR behavior. Current valid values are:

  • legacy_layout: a heuristics layout detection algorithm, which serves as an alternative to the current ML-based layout detection algorithm. Customers can choose the best suitable layout algorithm based on their situation.

repeated string advanced_ocr_options = 11;

Parameters
Name Description
index int

The index to set the value at.

value String

The advancedOcrOptions to set.

Returns
Type Description
TextDetectionParams.Builder

This builder for chaining.

setEnableTextDetectionConfidenceScore(boolean value)

public TextDetectionParams.Builder setEnableTextDetectionConfidenceScore(boolean value)

By default, Cloud Vision API only includes confidence score for DOCUMENT_TEXT_DETECTION result. Set the flag to true to include confidence score for TEXT_DETECTION as well.

bool enable_text_detection_confidence_score = 9;

Parameter
Name Description
value boolean

The enableTextDetectionConfidenceScore to set.

Returns
Type Description
TextDetectionParams.Builder

This builder for chaining.