REST Resource: projects.locations.products.referenceImages

Recurso: ReferenceImage

ReferenceImage representa una imagen de producto y sus metadatos asociados, como cuadros de límite.

Representación JSON
{
  "name": string,
  "uri": string,
  "boundingPolys": [
    {
      object(BoundingPoly)
    }
  ]
}
Campos
name

string

El nombre del recurso de la imagen de referencia

Formato:

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

Este campo se ignora cuando se crea una imagen de referencia.

uri

string

El URI de Google Cloud Storage de la imagen de referencia.

El URI debe comenzar con gs://.

Obligatorio.

boundingPolys[]

object(BoundingPoly)

Límites de polígonos en las áreas de interés en la imagen de referencia. Opcional. Si este campo está vacío, el sistema intentará detectar las regiones de interés. Se usarán, como máximo, 10 polígonos de límite.

La forma proporcionada se convierte en un rectángulo no rotado. Una vez convertido, el borde pequeño del rectángulo debe ser mayor o igual que 300 píxeles. La relación de aspecto debe ser de 1:4 o menos (es decir, 1:3 es aceptable; 1:5 no).

BoundingPoly

Un polígono de límite para la anotación de imagen detectada.

Representación JSON
{
  "vertices": [
    {
      object(Vertex)
    }
  ],
  "normalizedVertices": [
    {
      object(NormalizedVertex)
    }
  ]
}
Campos
vertices[]

object(Vertex)

Vértices del polígono de límite.

normalizedVertices[]

object(NormalizedVertex)

Vértices normalizados del polígono de límite.

Vertex

Un vértice representa un punto 2D en la imagen. NOTA: Las coordenadas de los vértices se encuentran en la misma escala que la imagen original.

Representación JSON
{
  "x": number,
  "y": number
}
Campos
x

number

Coordenada de X.

y

number

Coordenada de 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

Un vértice representa un punto 2D en la imagen. NOTA: Las coordenadas de vértices normalizadas están relacionadas con la imagen original y varían de 0 a 1.

Representación JSON
{
  "x": number,
  "y": number
}
Campos
x

number

Coordenada de X.

y

number

Coordenada de 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

Crea y muestra un recurso ReferenceImage nuevo.

delete

Borra de forma permanente una imagen de referencia

get

Obtiene información asociada a ReferenceImage.

list

Enumera imágenes de referencia.