REST Resource: projects.locations.products.referenceImages

Recurso: ReferenceImage

Um ReferenceImage representa uma imagem do produto e os respetivos metadados associados, como caixas de limite.

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.

Este campo é ignorado quando cria uma imagem de referência.

uri

string

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

O URI tem de começar por gs://.

Obrigatório.

boundingPolys[]

object(BoundingPoly)

Polígonos de delimitação em torno das áreas de interesse na imagem de referência. Opcional. Se este campo estiver vazio, o sistema tenta detetar regiões de interesse. São usados, no máximo, 10 polígonos delimitadores.

A forma fornecida é convertida num retângulo não rodado. Após a conversão, o lado mais pequeno do retângulo tem de ser igual ou superior a 300 píxeis. O formato tem de ser 1:4 ou inferior (ou seja, 1:3 é aceitável; 1:5 não é).

BoundingPoly

Um polígono de limite para a anotação de imagem detetada.

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. NOTA: as coordenadas dos vértices 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. NOTA: as coordenadas dos vértices normalizadas são relativas à imagem original e variam entre 0 e 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 devolve um novo recurso ReferenceImage.

delete

Elimina permanentemente uma imagem de referência.

get

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

list

Apresenta imagens de referência.