camera.processPicture
使用集合让一切井井有条
根据您的偏好保存内容并对其进行分类。
处理之前拍摄但尚未处理的图片。
此命令仅在您支持 delayProcessing
时才相关,因为
处理过程需要很长时间如果你不支持 delayProcessing
,
对此命令的请求应该会失败,并生成错误代码 disabledCommand。
此命令是在 API 级别 2 中添加的。
参数
- previewFileUrls:未处理图片的网址列表。
如果您要处理相机中所有未处理的图片,则为 [“all”]。
此字段不能为空。如果相机无法处理任何图片,
并不会返回错误,而是会忽略该网址并继续
极端情况可以是
previewToFinalFileUrls
,
作为空 JSONObject 返回。
结果
- previewToFinalFileUrls: JSON <key, value=""> 的 JSONObject
键值对,其中每个键都是预览图片的绝对网址,每个键
是对应的最终处理图片,可用于下载
直接使用相机拍摄请注意,此命令类似于
Camera.takePicture,不返回
previewToFinalFileUrls
(本段后面将会介绍的特殊情况除外),因为
处理(包括相机内拼接)通常需要一段时间(因
从几秒到几分钟)即可完成。系统会获取命令的进度
使用 /osc/commands/status API 定期轮询相机,并且
previewToFinalFileUrls
是执行以下命令时返回的结果:
。如果在命令完成之前与相机的连接断开,
客户端可以使用 listFiles
在重新连接到相机时获取最终图像的网址,或者
发出另一个 processPicture 命令,该命令应该返回
previewToFinalFileUrls
如果图片已经
。</key,>
错误
- disabledCommand:如果您不支持延迟处理。
- invalidParameterName:输入参数名称为
无法识别。
- invalidParameterValue::输入参数名称为
但其值无效;例如
previewFileUrls
无效。
命令 I/O |
命令输入 |
{
"parameters": {
"previewFileUrls": [
"previewFileUrl1",
"previewFileUrl2",
"previewFileUrl3",
...
"previewFileUrln"
]
}
} |
命令输出 |
{
"results": {
"previewToFinalFileUrls":{
"previewFileUrl1": "finalFileUrl1",
"previewFileUrl2": "finalFileUrl2",
"previewFileUrl3": "finalFileUrl3",
...
"previewFileUrln": "finalFileUrln"
}
}
} |
命令输出(错误) |
{
"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。"],[[["\u003cp\u003eThis command processes previously captured but unprocessed images, relevant only if \u003ccode\u003edelayProcessing\u003c/code\u003e is supported.\u003c/p\u003e\n"],["\u003cp\u003eIt accepts a list of preview image URLs as input, processing them into final images if possible, ignoring problematic URLs.\u003c/p\u003e\n"],["\u003cp\u003eThe command returns a JSON object mapping preview image URLs to their corresponding processed final image URLs.\u003c/p\u003e\n"],["\u003cp\u003eIt is only available in API level 2 and above, returning a \u003ccode\u003edisabledCommand\u003c/code\u003e error if \u003ccode\u003edelayProcessing\u003c/code\u003e is not supported.\u003c/p\u003e\n"],["\u003cp\u003ePotential errors include \u003ccode\u003einvalidParameterName\u003c/code\u003e for unrecognized input parameters and \u003ccode\u003einvalidParameterValue\u003c/code\u003e for invalid values like incorrect URLs.\u003c/p\u003e\n"]]],["This command processes previously captured, unprocessed images using a list of `previewFileUrls`. If \"all\" is provided, all unprocessed images are processed. The camera ignores problematic URLs and returns a `previewToFinalFileUrls` JSONObject mapping input URLs to final processed URLs. Errors include `disabledCommand` if delay processing isn't supported, and parameter-related issues like `invalidParameterName` or `invalidParameterValue`. This command requires API level 2.\n"],null,["# camera.processPicture\n\nProcess images, which were previously captured, but not processed yet.\nThis command is relevant only if you support `delayProcessing` since\nthe processing takes long. If you don't support `delayProcessing`,\nthe request for this command should fail with error code disabledCommand.\n**This command was added in API level 2.**\n\nParameters\n----------\n\n- **previewFileUrls:** A list of URLs of unprocessed images. If you want to process all unprocessed images in the camera, it is \\[\"all\"\\]. It cannot be empty. If the camera has trouble processing any image, the camera doesn't respond with error, instead, it should ignore that URL and proceed with others, and the extreme case can be `previewToFinalFileUrls` is returned as an empty JSONObject.\n\nResults\n-------\n\n- **previewToFinalFileUrls:** A JSONObject of JSON pairs, where each key is the absolute URL of the preview image, and each key is the corresponding final processed image and can be used to download directly from the camera. Please note this command is similar to camera.takePicture, and doesn't return `previewToFinalFileUrls` immediately (except for a corner case explained later in this paragraph) since the processing (including in-camera stitching) usually takes a while (varies from seconds to minutes) to complete. The progress of the command is obtained by polling the camera periodically using the [/osc/commands/status](/streetview/open-spherical-camera/guides/osc/commands/status) API and `previewToFinalFileUrls` is the result returned when the command finishes. If the connection to camera is lost before the command finishes, the client can use [listFiles](/streetview/open-spherical-camera/reference/camera/listFiles) to obtain the URLs of the final images when connected to the camera again or issue another processPicture command, which should return `previewToFinalFileUrls` immediately if the images were already processed before the reconnection.\n\nErrors\n------\n\n- **disabledCommand:** If you don't support delay processing.\n- **invalidParameterName:** The input parameter name is unrecognized.\n- **invalidParameterValue:** The input parameter name is recognized, but its value is invalid; for example, any URL in `previewFileUrls` is invalid.\n\n| Command I/O ----------- ||\n|----------------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| **Command Input** | ```text { \"parameters\": { \"previewFileUrls\": [ \"previewFileUrl1\", \"previewFileUrl2\", \"previewFileUrl3\", ... \"previewFileUrln\" ] } } ``` |\n| **Command Output** | ```text { \"results\": { \"previewToFinalFileUrls\":{ \"previewFileUrl1\": \"finalFileUrl1\", \"previewFileUrl2\": \"finalFileUrl2\", \"previewFileUrl3\": \"finalFileUrl3\", ... \"previewFileUrln\": \"finalFileUrln\" } } } ``` |\n| **Command Output (Error)** | ```text { \"error\": { \"code\": \"disabledCommand\", \"message\": \"Command is currently disabled.\" } } ``` |"]]