camera.takePicture
拍摄等距柱状图像,保存纬度/经度坐标
EXIF(如果您的相机自带 GPS 或在连接时启用了 GPS
手机)。致电camera.setOptions
(如果需要的话)。此命令已在 API 级别 2 中修改。
参数
结果
- API 级别 1
<ph type="x-smartling-placeholder">
- API 级别 2
<ph type="x-smartling-placeholder">
</ph>
- fileUrl::所拍图片的绝对网址,
用于直接从相机的 HTTP 服务器下载。请
请注意,此命令不会立即返回
fileUrl
,因为
拍摄(包括相机内拼接)通常需要一段时间(具体取决于
(几秒到几分钟)即可完成。命令的进度通过
使用 /osc/commands/status API 定期轮询相机,
fileUrl
是命令完成后返回的结果。时间
delayProcessing
为 true,它是预览的绝对网址
图片,可用作 processPicture 中的输入,
否则,就是最终处理后图片的绝对网址。
错误
- missing 参数:缺少
sessionId
。
此错误代码在 API 级别 2 中已废弃。
- invalidParameterName:参数名称无法识别,例如API 级别 2 中无法识别
sessionId
。
- invalidParameterValue::识别输入参数名称,
但其值无效;例如,
sessionId
不存在,
不再有效,或其数据类型不正确。此错误代码在 API 级别 2 中已废弃。
- disabledCommand:命令当前已停用;例如
相机处于视频拍摄模式。此错误代码已添加到 API 级别 2 中。
命令 I/O |
命令输入(API 级别 1) |
{ "parameters": { "sessionId": "12ABC3" } } |
命令输出(API 级别 1) |
{ "results": { "fileUri": "file URI" } } |
命令输出(错误)(API 级别 1) |
{ "error": { "code": "invalidParameterValue", "message": "Parameter sessionId doesn't exist." } } |
命令输入(API 级别 2) |
none |
命令输出(API 级别 2) |
{ "results": { "fileUrl": "Absolute file URL" } } |
命令输出(错误)(API 级别 2) |
{ "error": { "code": "disabledCommand", "message": "Command is currently disabled." } } |
如未另行说明,那么本页面中的内容已根据知识共享署名 4.0 许可获得了许可,并且代码示例已根据 Apache 2.0 许可获得了许可。有关详情,请参阅 Google 开发者网站政策。Java 是 Oracle 和/或其关联公司的注册商标。
最后更新时间 (UTC):2024-08-21。
[null,null,["最后更新时间 (UTC):2024-08-21。"],[[["Captures an equirectangular image and saves location coordinates to EXIF data."],["API level 1 uses `fileUri` for the image location, while API level 2 uses `fileUrl` and supports direct download."],["`sessionId` parameter is required for API level 1, but deprecated in API level 2."],["API level 2 introduces in-camera stitching and provides the final image URL after processing."],["Errors can occur due to missing or invalid parameters, or if the command is disabled (e.g., during video recording)."]]],["The command captures an equirectangular image, potentially saving GPS data to EXIF. In API level 1, a `sessionId` is required and the `fileUri` of the image is returned. API level 2 deprecates `sessionId`, instead returning a `fileUrl`, the absolute URL of the image, after a processing delay that is checked via polling. Errors include missing or invalid parameters, which were deprecated in API level 2, and disabled command for situations like when the camera is in video mode.\n"]]