ImageContext

Image context and/or feature-specific parameters.

JSON representation
{
  "latLongRect": {
    object(LatLongRect)
  },
  "languageHints": [
    string
  ],
  "cropHintsParams": {
    object(CropHintsParams)
  },
  "productSearchParams": {
    object(ProductSearchParams)
  },
  "webDetectionParams": {
    object(WebDetectionParams)
  },
  "textDetectionParams": {
    object(TextDetectionParams)
  },
  "qualityOptimizationParams": {
    object(QualityOptimizationParams)
  },
  "documentParsingParams": {
    object(DocumentParsingParams)
  }
}
Fields
latLongRect

object(LatLongRect)

Not used.

languageHints[]

string

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

cropHintsParams

object(CropHintsParams)

Parameters for crop hints annotation request.

productSearchParams

object(ProductSearchParams)

Parameters for product search.

webDetectionParams

object(WebDetectionParams)

Parameters for web detection.

textDetectionParams

object(TextDetectionParams)

Parameters for document text detection.

qualityOptimizationParams

object(QualityOptimizationParams)

Parameters for image quality optimizations.

documentParsingParams

object(DocumentParsingParams)

Parameters for document parsing.

LatLongRect

Rectangle determined by min and max LatLng pairs.

JSON representation
{
  "minLatLng": {
    object(LatLng)
  },
  "maxLatLng": {
    object(LatLng)
  }
}
Fields
minLatLng

object(LatLng)

Min lat/long pair.

maxLatLng

object(LatLng)

Max lat/long pair.

CropHintsParams

Parameters for crop hints annotation request.

JSON representation
{
  "aspectRatios": [
    number
  ]
}
Fields
aspectRatios[]

number

Aspect ratios in floats, representing the ratio of the width to the height of the image. For example, if the desired aspect ratio is 4/3, the corresponding float value should be 1.33333. If not specified, the best possible crop is returned. The number of provided aspect ratios is limited to a maximum of 16; any aspect ratios provided after the 16th are ignored.

ProductSearchParams

Parameters for a product search request.

JSON representation
{
  "boundingPoly": {
    object(BoundingPoly)
  },
  "productSet": string,
  "productCategories": [
    string
  ],
  "filter": string
}
Fields
boundingPoly

object(BoundingPoly)

The bounding polygon around the area of interest in the image. Optional. If it is not specified, system discretion will be applied.

productSet

string

The resource name of a ProductSet to be searched for similar images.

Format is: projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID.

productCategories[]

string

The list of product categories to search in. Currently, we only consider the first category, and either "homegoods", "apparel", or "toys" should be specified.

filter

string

The filtering expression. This can be used to restrict search results based on Product labels. We currently support an AND of OR of key-value expressions, where each expression within an OR must have the same key.

For example, "(color = red OR color = blue) AND brand = Google" is acceptable, but not "(color = red OR brand = Google)" or "color: red".

WebDetectionParams

Parameters for web detection request.

JSON representation
{
  "includeGeoResults": boolean
}
Fields
includeGeoResults

boolean

Whether to include results derived from the geo information in the image.

TextDetectionParams

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

JSON representation
{
  "disableOrientationDetection": boolean,
  "disableTextAnnotations": boolean,
  "pageFilter": string,
  "blockFilter": string,
  "paragraphFilter": string,
  "wordFilter": string,
  "symbolFilter": string
}
Fields
disableOrientationDetection

boolean

Disables orientation detection such that rotated text will not be detected. This is only supported for DOCUMENT_TEXT_DETECTION.

disableTextAnnotations

boolean

Disables the old textAnnotations field. Only full_text_annotations will be returned.

pageFilter

string (FieldMask format)

Controls what data is returned at the page level in fullTextAnnotation. Default when unset: All fields are included

A comma-separated list of fully qualified names of fields. Example: "user.displayName,photo".

blockFilter

string (FieldMask format)

Controls what data is returned at the block level in fullTextAnnotation. Default when unset: All fields are included except mergedText.

A comma-separated list of fully qualified names of fields. Example: "user.displayName,photo".

paragraphFilter

string (FieldMask format)

Controls what data is returned at the paragraph level in fullTextAnnotation. Default when unset: All fields are included except mergedText

A comma-separated list of fully qualified names of fields. Example: "user.displayName,photo".

wordFilter

string (FieldMask format)

Controls what data is returned at the word level in fullTextAnnotation. Default when unset: All fields are included except mergedText

A comma-separated list of fully qualified names of fields. Example: "user.displayName,photo".

symbolFilter

string (FieldMask format)

Controls what data is returned at the symbol level in fullTextAnnotation. Default when unset: All fields are included except boundingBox

A comma-separated list of fully qualified names of fields. Example: "user.displayName,photo".

QualityOptimizationParams

Parameters for image quality optimizations.

JSON representation
{
  "type": enum(Type),
  "compressionConfig": {
    object(CompressionConfig)
  },
  "enhancementConfig": {
    object(EnhancementConfig)
  },
  "qualityScoreConfig": {
    object(QualityScoreConfig)
  }
}
Fields
type

enum(Type)

Choose one optimization type.

compressionConfig

object(CompressionConfig)

Specify compression configuration.

enhancementConfig

object(EnhancementConfig)

Specify auto enhancement configuration.

qualityScoreConfig

object(QualityScoreConfig)

Specify quality score configuration.

CompressionConfig

Configuration for COMPRESSION.

JSON representation
{
  "targetQuality": number
}
Fields
targetQuality

number

In range [0, 1]. Target quality after compression. 1 means lossless compared to input image, 0 means no minimum quality requirement.

EnhancementConfig

Configuration for ENHANCMENT. If not specify enhancementConfig, default values sharpeningLevel equals to 0.5, autoHdrLevel equals to 0.5 and upscaleRatio equals to 1 will be used. If you want to customize any of the three parameters, you need to specify the whole EnhancementConfig. For example, if you want to use higher autoHdrLevel, which usually will make the image brighter, and keep sharpnening level and upscale ratio the same as default, you can set the config as: enhancementConfig { sharpeningLevel: 0.5 autoHdrLevel: 1.0 upscaleRatio: 1 }

JSON representation
{
  "sharpeningLevel": number,
  "autoHdrLevel": number,
  "upscaleRatio": number
}
Fields
sharpeningLevel

number

In range [0,1]. Level of sharpening, 0 means no sharpening, 1 means largest sharpening. Default is 0.5.

autoHdrLevel

number

In range [0,1]. Level of Auto HDR, 0 means no auto HDR, 1 means largest AutoHDR. Default is 0.5.

upscaleRatio

number

In range [1, 2]. Whether do upscaling, default value will be 1, which means no upscaling. If specified, the output height and width will be equals to original height and width times upscaleRatio.

QualityScoreConfig

Configuration for QUALITY_SCORE.

JSON representation
{
  "qualityModel": string
}
Fields
qualityModel

string

Specify which model to be used. Default value is empty string, and aesthetic score will be returned. Another supported quality model is "builtin/technical-score", which will return image technical quality.

DocumentParsingParams

Parameters for DOCUMENT_PARSING feature.

JSON representation
{
  "disableOrientationDetection": boolean,
  "tableDetectionOptions": {
    object(TableDetectionOptions)
  },
  "documentType": string
}
Fields
disableOrientationDetection

boolean

Disables orientation detection such that rotated text will not be detected.

tableDetectionOptions

object(TableDetectionOptions)

Controls table detection behavior. Table detection is disabled if this field is not set.

documentType

string

Specify a known document type for deeper structure detection. Valid values are currently "invoice" or "general".

TableDetectionOptions

Options for the table detection.

JSON representation
{
  "tableBoundHints": [
    {
      object(TableBoundHint)
    }
  ]
}
Fields
tableBoundHints[]

object(TableBoundHint)

Optional table bounding box hints that can be provided for complex cases which our algorithm cannot locate the table(s) in.

TableBoundHint

A hint for a table bounding box on the page for table parsing.

JSON representation
{
  "pageNumber": number,
  "boundingBox": {
    object(BoundingPoly)
  }
}
Fields
pageNumber

number

Optional page number for multi-paged inputs this hint applies to. If not provided, this hint will apply to all pages by default. This value is 1-indexed.

boundingBox

object(BoundingPoly)

Bounding box hint for a table on this page. The coordinates must be normalized to [0,1] and the bounding box must be an axis-aligned rectangle.