资源:ReferenceImage
ReferenceImage
表示商品图片及其关联的元数据,例如边界框。
JSON 表示法 | |
---|---|
{
"name": string,
"uri": string,
"boundingPolys": [
{
object( |
字段 | |
---|---|
name |
参考图片的资源名称。 格式为:
创建参考图片时,系统会忽略此字段。 |
uri |
参考图片的 Google Cloud Storage URI。 URI 必须以 必填。 |
boundingPolys[] |
参考图片内感兴趣的区域周围的边界多边形。可选。如果此字段为空,系统将尝试检测感兴趣的区域。最多可使用 10 个边界多边形。 所提供的形状将转换为非旋转式矩形。转换完毕后,矩形的短边必须大于或等于 300 像素。宽高比不得超过 1:4(即 1:3 可接受,1:5 则不可接受)。 |
BoundingPoly
检测到的图片注释的边界多边形。
JSON 表示法 | |
---|---|
{ "vertices": [ { object( |
字段 | |
---|---|
vertices[] |
外接多边形的顶点。 |
normalizedVertices[] |
外接多边形的规范化顶点。 |
Vertex
顶点表示图片中的 2D 点。注意:顶点坐标与原始图片的比例相同。
JSON 表示法 | |
---|---|
{ "x": number, "y": number } |
字段 | |
---|---|
x |
x 坐标。 |
y |
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}]
[{},{"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
顶点表示图片中的 2D 点。注意:标准化顶点坐标相对于原始图片,范围介于 0 和 1 之间。
JSON 表示法 | |
---|---|
{ "x": number, "y": number } |
字段 | |
---|---|
x |
x 坐标。 |
y |
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}]
[{},{"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.
方法 |
|
---|---|
|
创建并返回新的 ReferenceImage 资源。 |
|
永久删除一张参考图片。 |
|
获取与 ReferenceImage 关联的信息。 |
|
列出参考图片。 |