更新时间:2025-05-26 GMT+08:00
分享

2D图像场景生成

功能介绍

用户可使用该api生成不同的2D场景图片。该api单次调用耗时长,建议调用方设置最长超时等待时间为 60秒;多次调用时,建议收到响应后再下发新的请求。

URI

POST https://{host_url}/v1.0/{project_id}/admodel/images/2d-generate

表1 路径参数

参数

是否必选

参数类型

描述

project_id

String

项目id

表2 Query参数

参数

是否必选

参数类型

描述

type

String

生成图像类型。地锁的只能生成鱼眼摄像头的图像,使用 fish_eye,其他的只能生成普通摄像头的图像,使用normal。

请求参数

表3 请求Body参数

参数

是否必选

参数类型

描述

view

String

相机视角

height

Integer

生成图片的高度

width

Integer

生成图片的宽度

image_type

String

生成图片的类型,默认生成JPG格式的

weather

String

天气

period

String

时间段,光照效果

gen_objects

Array of GenObject objects

生成图片中包含的对象信息

表4 GenObject

参数

是否必选

参数类型

描述

type

String

生成的对象类型

bbox

BboxInfo object

边界框

表5 BboxInfo

参数

是否必选

参数类型

描述

xmin

Number

x坐标最小值

ymin

Number

y坐标最小值

xmax

Number

x坐标最大值

ymax

Number

y坐标最大值

响应参数

状态码:200

表6 响应Body参数

参数

参数类型

描述

image

String

生成图像的base64编码

状态码:400

表7 响应Body参数

参数

参数类型

描述

error_code

String

错误码

error_name

String

错误名称

error_msg

String

错误信息

error_suggestion

String

错误恢复建议

error_context

String

错误描述

current_time

String

当前时间

请求示例

2D图像场景生成请求体

POST https://{endpoint}/v1.0/{project_id}/admodel/images/2d-generate?type=fish_eye

响应示例

状态码:200

OK

{
  "image" : ""
}

状态码:400

Bad Request

{
  "error_code" : "000003",
  "error_name" : "octopus_request_param_error",
  "error_msg" : "Request params [] is invalid.",
  "error_suggestion" : "Please confirm that the request params [] is correct.",
  "error_context" : "Field error on field: [], rejected value: []; Message: Value is not valid.",
  "current_time" : "2023-12-13T09:56:21Z"
}

状态码

状态码

描述

200

OK

400

Bad Request

403

权限校验失败

500

系统内部错误

错误码

请参见错误码

相关文档