מצלמה.עיבוד תמונה
קל לארגן דפים בעזרת אוספים
אפשר לשמור ולסווג תוכן על סמך ההעדפות שלך.
מעבדים תמונות שצולמו בעבר, אבל עדיין לא עובדו.
הפקודה הזו רלוונטית רק אם יש תמיכה ב-delayProcessing
מאז
תהליך העיבוד נמשך זמן רב. אם אין תמיכה ב-delayProcessing
,
הבקשה לפקודה הזו אמורה להיכשל וקוד השגיאה disabledCommand.
הפקודה הזו נוספה ברמת API 2.
פרמטרים
- previewFileUrls: רשימה של כתובות URL של תמונות שלא עברו עיבוד.
אם רוצים לעבד את כל התמונות שלא עובדו במצלמה, צריך לבחור ['הכול'].
השדה לא יכול להיות ריק. אם יש בעיה בעיבוד תמונה כלשהי באמצעות המצלמה,
לא מגיב עם שגיאה, במקום זאת, עליו להתעלם מכתובת האתר הזו ולהמשיך עם
אחרים, והמקרה הקיצוני יכול להיות
previewToFinalFileUrls
הוא
מוחזר כ-JSONObject ריק.
תוצאות
- previewToFinalFileUrls: אובייקט JSON של JSON <key, value="">
שבהם כל מפתח הוא כתובת ה-URL המוחלטת של תמונת התצוגה המקדימה, וכל מפתח
היא התמונה הסופית המתאימה שעברה עיבוד, ואפשר להשתמש בה כדי להוריד
ישירות מהמצלמה. שימו לב שפקודה זו דומה ל-
Camera.takePicture ולא מחזירה
previewToFinalFileUrls
מיד (למעט מקרה פינתי שמוסבר בהמשך פסקה זו) מאחר
העיבוד (כולל חיבור במצלמה) נמשך בדרך כלל זמן מה (משתנה
משניות לדקות) כדי להשלים את התהליך. הצגת ההתקדמות של הפקודה
על ידי דגימה של המצלמה מדי פעם באמצעות ה-API /osc/commands/status ו
previewToFinalFileUrls
הוא התוצאה שמוחזרת כשהפקודה
מסתיים. אם החיבור למצלמה מתנתק לפני שהפקודה מסתיימת,
הלקוח יכול להשתמש ב-listFiles
להשיג את כתובות ה-URL של התמונות הסופיות כשמחברים אותן מחדש למצלמה,
תנפיק עוד פקודת עיבוד תמונה שחוזרת
previewToFinalFileUrls
מיד אם התמונות כבר
מעובד לפני החיבור מחדש.</key,>
שגיאות
- הפקודה מושבתת: אם לא תומכים בעיבוד מושהה.
- falseParameterName: השם של פרמטר הקלט הוא
לא מזוהה.
- invalidParameterValue: שם פרמטר הקלט הוא
מזוהה, אבל הערך שלו לא חוקי. לדוגמה, כל כתובת URL
הכתובת
previewFileUrls
לא תקינה.
Command 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."
}
} |
אלא אם צוין אחרת, התוכן של דף זה הוא ברישיון Creative Commons Attribution 4.0 ודוגמאות הקוד הן ברישיון Apache 2.0. לפרטים, ניתן לעיין במדיניות האתר Google Developers. Java הוא סימן מסחרי רשום של חברת Oracle ו/או של השותפים העצמאיים שלה.
עדכון אחרון: 2024-08-21 (שעון UTC).
[null,null,["עדכון אחרון: 2024-08-21 (שעון UTC)."],[[["\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.\" } } ``` |"]]