camera.takePicture
Stay organized with collections
Save and categorize content based on your preferences.
Captures an equirectangular image, saving lat/long coordinates
to EXIF (if your camera features its own GPS or GPS is enabled on connected
mobile phones). Call camera.setOptions
prior to this command call if needed. This command was modified in API level 2.
Parameters
- sessionId: Unique session identifier obtained from the
camera.startSession
command.
This field was deprecated in API level 2.
Results
- API level 1
- fileUri: URI of the captured image. Manufacturers
decide whether to use absolute or relative URIs; for example,
"http://android.com/robots.txt" is an
absolute URI while "robots.txt" is a relative URI. Clients may treat
this as an opaque identifier.
- API level 2
- fileUrl: Absolute URL of the captured image, which can
be used to download directly from the HTTP server of the camera. Please
note this command doesn’t return
fileUrl
immediately since the
capture (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 API and
fileUrl
is the result returned when the command finishes. When
delayProcessing
is true, it is the absolute URL of the preview
image, which can be used as input in processPicture to process the image,
otherwise, it is the absolute URL of the final processed image.
Errors
- missingParameter:
sessionId
is missing.
This error code was deprecated in API level 2.
- invalidParameterName: The parameter name is unrecognized, e.g.
sessionId
is not recognized in API level 2.
- invalidParameterValue: The input parameter name is recognized,
but its value is invalid; for example, the
sessionId
doesn't exist,
is no longer active, or its data type is incorrect. This error code was deprecated in API level 2.
- disabledCommand: Command is currently disabled; for example,
the camera is in video shooting mode. This error code was added in API level 2.
Command I/O |
Command Input (API level 1) |
{
"parameters": {
"sessionId": "12ABC3"
}
} |
Command Output (API level 1) |
{
"results": {
"fileUri": "file URI"
}
} |
Command Output (Error) (API level 1) |
{
"error": {
"code": "invalidParameterValue",
"message": "Parameter sessionId doesn't exist."
}
} |
Command Input (API level 2) |
none |
Command Output (API level 2) |
{
"results": {
"fileUrl": "Absolute file URL"
}
} |
Command Output (Error) (API level 2) |
{
"error": {
"code": "disabledCommand",
"message": "Command is currently disabled."
}
} |
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2024-10-09 UTC.
[null,null,["Last updated 2024-10-09 UTC."],[[["\u003cp\u003eCaptures an equirectangular image and saves location coordinates to EXIF data.\u003c/p\u003e\n"],["\u003cp\u003eAPI level 1 uses \u003ccode\u003efileUri\u003c/code\u003e for the image location, while API level 2 uses \u003ccode\u003efileUrl\u003c/code\u003e and supports direct download.\u003c/p\u003e\n"],["\u003cp\u003e\u003ccode\u003esessionId\u003c/code\u003e parameter is required for API level 1, but deprecated in API level 2.\u003c/p\u003e\n"],["\u003cp\u003eAPI level 2 introduces in-camera stitching and provides the final image URL after processing.\u003c/p\u003e\n"],["\u003cp\u003eErrors can occur due to missing or invalid parameters, or if the command is disabled (e.g., during video recording).\u003c/p\u003e\n"]]],["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"],null,["# camera.takePicture\n\nCaptures an equirectangular image, saving lat/long coordinates\nto EXIF (if your camera features its own GPS or GPS is enabled on connected\nmobile phones). Call [camera.setOptions](/streetview/open-spherical-camera/reference/camera/setoptions)\nprior to this command call if needed. **This command was modified in API level 2.**\n\nParameters\n----------\n\n- **sessionId:** Unique session identifier obtained from the [camera.startSession](/streetview/open-spherical-camera/reference/camera/startsession)command. **This field was deprecated in API level 2.**\n\nResults\n-------\n\n- **API level 1**\n - **fileUri:** URI of the captured image. Manufacturers decide whether to use absolute or relative URIs; for example, \"\u003chttp://android.com/robots.txt\u003e\" is an absolute URI while \"robots.txt\" is a relative URI. Clients may treat this as an opaque identifier.\n- **API level 2**\n - **fileUrl:** Absolute URL of the captured image, which can be used to download directly from the HTTP server of the camera. Please note this command doesn't return `fileUrl` immediately since the capture (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 `fileUrl` is the result returned when the command finishes. When `delayProcessing` is true, it is the absolute URL of the preview image, which can be used as input in processPicture to process the image, otherwise, it is the absolute URL of the final processed image.\n\nErrors\n------\n\n- **missingParameter:** `sessionId` is missing. **This error code was deprecated in API level 2.**\n- **invalidParameterName:** The parameter name is unrecognized, e.g. `sessionId` is not recognized in API level 2.\n- **invalidParameterValue:** The input parameter name is recognized, but its value is invalid; for example, the `sessionId` doesn't exist, is no longer active, or its data type is incorrect. **This error code was deprecated in API level 2.**\n- **disabledCommand:** Command is currently disabled; for example, the camera is in video shooting mode. **This error code was added in API level 2.**\n\n| Command I/O ----------- ||\n|------------------------------------------|---------------------------------------------------------------------------------------------------------------|\n| **Command Input (API level 1)** | ```text { \"parameters\": { \"sessionId\": \"12ABC3\" } } ``` |\n| **Command Output (API level 1)** | ```text { \"results\": { \"fileUri\": \"file URI\" } } ``` |\n| **Command Output (Error) (API level 1)** | ```text { \"error\": { \"code\": \"invalidParameterValue\", \"message\": \"Parameter sessionId doesn't exist.\" } } ``` |\n| **Command Input (API level 2)** | ```text none ``` |\n| **Command Output (API level 2)** | ```text { \"results\": { \"fileUrl\": \"Absolute file URL\" } } ``` |\n| **Command Output (Error) (API level 2)** | ```text { \"error\": { \"code\": \"disabledCommand\", \"message\": \"Command is currently disabled.\" } } ``` |"]]