camera.processPicture
處理先前已擷取但尚未處理的圖片。
只有在支援 delayProcessing
的情況下,才需要使用這個指令,因為
處理時間會很長如果不支援 delayProcessing
,
這個指令的要求應會失敗,並呈現已停用的錯誤代碼。
這項指令已新增至 API 級別 2。
參數
- previewFileUrls:未處理圖片的網址清單。
如果你想處理相機中所有尚未處理的圖片,請選擇「all」。
欄位不得留空。如果相機在處理任何圖片時發生問題,請使用相機
未傳回錯誤,而是忽略該網址並繼續
其他例子,最極端的情況則是
previewToFinalFileUrls
以空白的 JSONObject 的形式傳回
結果
- previewToFinalFileUrls:JSON 物件 (JSON <key, value="">)
,其中每個鍵都是預覽圖片的絕對網址,而每個鍵
是對應的最終處理圖片,可透過該圖片下載
直接擷取相機鏡頭即可請注意,這個指令類似於
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." } } |
除非另有註明,否則本頁面中的內容是採用創用 CC 姓名標示 4.0 授權,程式碼範例則為阿帕契 2.0 授權。詳情請參閱《Google Developers 網站政策》。Java 是 Oracle 和/或其關聯企業的註冊商標。
上次更新時間:2024-08-21 (世界標準時間)。
[null,null,["上次更新時間:2024-08-21 (世界標準時間)。"],[[["This command processes previously captured but unprocessed images, relevant only if `delayProcessing` is supported."],["It accepts a list of preview image URLs as input, processing them into final images if possible, ignoring problematic URLs."],["The command returns a JSON object mapping preview image URLs to their corresponding processed final image URLs."],["It is only available in API level 2 and above, returning a `disabledCommand` error if `delayProcessing` is not supported."],["Potential errors include `invalidParameterName` for unrecognized input parameters and `invalidParameterValue` for invalid values like incorrect URLs."]]],["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"]]