REST Resource: projects.locations.products.referenceImages

Recurso: ReferenceImage

Uma ReferenceImage representa uma imagem de produto e os metadados associados, como caixas delimitadoras.

Representação JSON
{
  "name": string,
  "uri": string,
  "boundingPolys": [
    {
      object(BoundingPoly)
    }
  ]
}
Campos
name

string

O nome do recurso da imagem de referência.

O formato é:

projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID/referenceImages/IMAGE_ID

Esse campo é ignorado quando uma imagem de referência é criada.

uri

string

URI do Google Cloud Storage da imagem de referência.

O URI precisa começar com gs://.

Obrigatório.

boundingPolys[]

object(BoundingPoly)

Polígonos delimitadores em torno das áreas de interesse na imagem de referência. Opcional. Se este campo estiver vazio, o sistema tentará detectar regiões de interesse. No máximo, 10 polígonos delimitadores serão usados.

A forma fornecida é convertida em um retângulo não girado. Depois de convertida, a borda pequena do retângulo precisa ser maior ou igual a 300 pixels. A proporção deve ser de 1:4 ou menos (ou seja, 1:3 é aceitável; 1:5 não é).

BoundingPoly

Um polígono delimitador para a anotação de imagem detectada.

Representação JSON
{
  "vertices": [
    {
      object(Vertex)
    }
  ],
  "normalizedVertices": [
    {
      object(NormalizedVertex)
    }
  ]
}
Campos
vertices[]

object(Vertex)

Os vértices do polígono delimitador.

normalizedVertices[]

object(NormalizedVertex)

Os vértices normalizados do polígono delimitador.

Vertex

Um vértice representa um ponto 2D na imagem. OBSERVAÇÃO: as coordenadas do vértice estão na mesma escala que a imagem original.

Representação JSON
{
  "x": number,
  "y": number
}
Campos
x

number

Coordenada X.

y

number

Coordenada Y.

Zero coordinate values


The general format for bounding polys in the JSON response when detected is an array of 4 vertex objects:
  • [{"x": 63,"y": 18},{"x": 123,"y": 18},{"x": 123,"y": 38},{"x": 63,"y": 38}]
When the API detects a coordinate ("x" or "y") value of 0, that coordinate is omitted in the JSON response. For example, a response could take the following form: [{},{"x": 28}, {"x": 28,"y": 43},{"y": 43}]. This response shows all three representation possibilities:
  • {} - an empty object when both "x":0 and "y":0.
  • {"x": 28} and {"y": 43} - an object with a single key-value pair when one coordinate is 0 but the other is a non-zero value.
  • {"x": 28,"y": 43} - an object with both key-value pairs when both coordinates have a non-zero value.

NormalizedVertex

Um vértice representa um ponto 2D na imagem. OBSERVAÇÃO: as coordenadas do vértice normalizado são relativas à imagem original e variam de 0 a 1.

Representação JSON
{
  "x": number,
  "y": number
}
Campos
x

number

Coordenada X.

y

number

Coordenada Y.

Zero coordinate values


The general format for bounding polys in the JSON response when detected is an array of 4 vertex objects:
  • [{"x": 0.063,"y": 0.018},{"x": 0.123,"y": 0.018},{"x": 0.123,"y": 0.038},{"x": 0.063,"y": 0.038}]
When the API detects a coordinate ("x" or "y") value of 0.0, that coordinate is omitted in the JSON response. For example, a response could take the following form: [{},{"x": 0.028}, {"x": 0.028,"y": 0.043},{"y": 0.043}]. This response shows all three representation possibilities:
  • {} - an empty object when both "x":0.0 and "y":0.0.
  • {"x": 0.028} and {"y": 0.043} - an object with a single key-value pair when one coordinate is 0.0 but the other is a non-zero value.
  • {"x": 0.028,"y": 0.043} - an object with both key-value pairs when both coordinates have a non-zero value.

Métodos

create

Cria e retorna um novo recurso ReferenceImage.

delete

Exclui permanentemente uma imagem de referência.

get

Obtém informações associadas a uma ReferenceImage.

list

Lista as imagens de referência.