camera.takePicture
擷取等矩長方形圖片,儲存經緯度座標
至 EXIF (您的相機有其專屬 GPS 或在連線時啟用 GPS)
行動電話)。致電「camera.setOptions
」
再進行這項作業這個指令是在 API 級別 2 中修改。
參數
結果
- API 級別 1
- API 級別 2
- fileUrl:擷取資料的絕對網址,
直接從相機的 HTTP 伺服器下載。請
請注意,這個指令不會立即傳回
fileUrl
,因為
拍攝 (包括使用相機內拼接) 通常需要一點時間 (視
秒到幾分鐘) 才能完成。指令的執行進度會由
利用 /osc/commands/status API 定期輪詢相機,並
fileUrl
是指令執行完畢後傳回的結果。時間
delayProcessing
為 true,這是預覽的絕對網址
圖片,並可做為 processP 的輸入內容處理圖片
否則,就會是最終處理後圖片的絕對網址。
錯誤
- missingParameter:缺少
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." } } |
除非另有註明,否則本頁面中的內容是採用創用 CC 姓名標示 4.0 授權,程式碼範例則為阿帕契 2.0 授權。詳情請參閱《Google Developers 網站政策》。Java 是 Oracle 和/或其關聯企業的註冊商標。
上次更新時間:2024-08-21 (世界標準時間)。
[null,null,["上次更新時間: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"]]