camera.processPicture

Process images, which were previously captured, but not processed yet. This command is relevant only if you support delayProcessing since the processing takes long. If you don’t support delayProcessing, the request for this command should fail with error code disabledCommand. This command was added in API level 2.

Parameters

  • 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.

Results

  • 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 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 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.

Errors

  • disabledCommand: If you don’t support delay processing.
  • invalidParameterName: The input parameter name is unrecognized.
  • invalidParameterValue: The input parameter name is recognized, but its value is invalid; for example, any URL in previewFileUrls is invalid.

Command I/O

Command Input
{
    "parameters": {
        "previewFileUrls": [
            "previewFileUrl1",
            "previewFileUrl2",
            "previewFileUrl3",
            ...
            "previewFileUrln"
        ]
    }
}
Command Output
{
    "results": {
        "previewToFinalFileUrls":{
            "previewFileUrl1": "finalFileUrl1",
            "previewFileUrl2": "finalFileUrl2",
            "previewFileUrl3": "finalFileUrl3",
            ...
            "previewFileUrln": "finalFileUrln"
        }
    }
}
Command Output (Error)
{
    "error": {
        "code": "disabledCommand",
        "message": "Command is currently disabled."
    }
}