REST Resource: projects.locations.products.referenceImages

Resource: ReferenceImage

ReferenceImage mewakili gambar produk dan metadatanya yang terkait, seperti kotak pembatas.

Representasi JSON
{
  "name": string,
  "uri": string,
  "boundingPolys": [
    {
      object(BoundingPoly)
    }
  ]
}
Kolom
name

string

Nama resource gambar referensi.

Formatnya adalah:

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

Kolom ini diabaikan saat membuat gambar referensi.

uri

string

URI Google Cloud Storage gambar referensi.

URI harus diawali dengan gs://.

Wajib.

boundingPolys[]

object(BoundingPoly)

Poligon pembatas di sekitar area minat pada gambar referensi. Opsional. Jika kolom ini kosong, sistem akan mencoba mendeteksi wilayah yang diinginkan. Maksimal 10 poligon pembatas akan digunakan.

Bentuk yang disediakan diubah menjadi persegi panjang yang tidak diputar. Setelah dikonversi, tepi kecil persegi panjang harus lebih besar dari atau sama dengan 300 piksel. Rasio aspek harus 1:4 atau lebih kecil (artinya, 1:3 tidak masalah; 1:5 tidak disarankan).

BoundingPoly

Poligon pembatas untuk anotasi gambar yang terdeteksi.

Representasi JSON
{
  "vertices": [
    {
      object(Vertex)
    }
  ],
  "normalizedVertices": [
    {
      object(NormalizedVertex)
    }
  ]
}
Kolom
vertices[]

object(Vertex)

Puncak poligon pembatas.

normalizedVertices[]

object(NormalizedVertex)

Verteks poligon pembatas yang dinormalisasi.

Vertex

verteks mewakili titik 2D pada gambar. CATATAN: koordinat verteks memiliki skala yang sama dengan gambar asli.

Representasi JSON
{
  "x": number,
  "y": number
}
Kolom
x

number

Koordinat x.

y

number

Koordinat 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

verteks mewakili titik 2D pada gambar. CATATAN: koordinat verteks yang dinormalisasi akan relatif terhadap gambar asli dan memiliki rentang dari 0 hingga 1.

Representasi JSON
{
  "x": number,
  "y": number
}
Kolom
x

number

Koordinat x.

y

number

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

Metode

create

Membuat dan menampilkan resource ReferenceImage baru.

delete

Menghapus gambar referensi secara permanen.

get

Mendapatkan informasi yang terkait dengan ReferenceImage.

list

Mencantumkan gambar referensi.