This shows you the differences between two versions of the page.
— |
script-hdr-ricoh-theta-v-extreme [2018/04/10 11:35] (current) teq created |
||
---|---|---|---|
Line 1: | Line 1: | ||
+ | ====== Ricoh Theta V: 60 pictures HDR ====== | ||
+ | This script captures 60 (!) pictures with different exposure times. | ||
+ | <code javascript> | ||
+ | /** | ||
+ | * HDR capturing example (Ricoh Theta V). | ||
+ | * Author: Camera Controller | ||
+ | * Web: http://www.tequnique.com/cameracontroller | ||
+ | * Description: This example shows how to capture exposure series (e.g. for HDR) using 60 | ||
+ | * different exposure times. | ||
+ | */ | ||
+ | |||
+ | // Helper function for capturing an image with a specific exposure | ||
+ | function captureImage(cameraName, exposureCommand) { | ||
+ | // Set exposure | ||
+ | var result = sendCustomCameraCommand(cameraName, exposureCommand); | ||
+ | if (!result.ok) { | ||
+ | logMessage("Error setting exposure: " + result.message, true); | ||
+ | } | ||
+ | |||
+ | // Capture photo | ||
+ | result = startRecording(cameraName); | ||
+ | if (!result.ok) { | ||
+ | logMessage("Error capturing photo: " + result.message, true); | ||
+ | } | ||
+ | } | ||
+ | |||
+ | // Information | ||
+ | logMessage("This example captures pictures with all 60 available exposure times (manual mode) with Ricoh Theta V cameras."); | ||
+ | |||
+ | // Use the currently connected camera: | ||
+ | var connectResult = connectToCamera(); | ||
+ | if (connectResult.ok) { | ||
+ | var cameraName = connectResult.message; | ||
+ | |||
+ | // Change the camera mode to 0 (which is photo mode for Theta cameras). The index | ||
+ | // depends on the camera model. | ||
+ | var result = changeCameraMode(cameraName, 0); | ||
+ | if (!result.ok) { | ||
+ | logMessage("Error changing camera mode to photo: " + result.message, true); | ||
+ | } | ||
+ | |||
+ | // Give the camera some time for changing the mode | ||
+ | waitMilliseconds(500); | ||
+ | |||
+ | // Log the current camera mode | ||
+ | var cameraModeIndex = getCurrentCameraMode(cameraName); | ||
+ | logMessage("The current camera mode is: " + cameraModeIndex); | ||
+ | |||
+ | // Set manual exposure program | ||
+ | result = sendCustomCameraCommand(cameraName, "exposureProgram:1"); | ||
+ | if (!result.ok) { | ||
+ | logMessage("Error enabling program: " + result.message, true); | ||
+ | } | ||
+ | |||
+ | var expTimes = [ | ||
+ | "0.00004", | ||
+ | "0.00005", | ||
+ | "0.0000625", | ||
+ | "0.00008", | ||
+ | "0.0001", | ||
+ | "0.000125", | ||
+ | "0.00015625", | ||
+ | "0.0002", | ||
+ | "0.00025", | ||
+ | "0.0003125", | ||
+ | "0.0004", | ||
+ | "0.0005", | ||
+ | "0.000625", | ||
+ | "0.0008", | ||
+ | "0.001", | ||
+ | "0.00125", | ||
+ | "0.0015625", | ||
+ | "0.002", | ||
+ | "0.0025", | ||
+ | "0.003125", | ||
+ | "0.004", | ||
+ | "0.005", | ||
+ | "0.00625", | ||
+ | "0.008", | ||
+ | "0.01", | ||
+ | "0.0125", | ||
+ | "0.01666666", | ||
+ | "0.02", | ||
+ | "0.025", | ||
+ | "0.03333333", | ||
+ | "0.04", | ||
+ | "0.05", | ||
+ | "0.06666666", | ||
+ | "0.07692307", | ||
+ | "0.1", | ||
+ | "0.125", | ||
+ | "0.16666666", | ||
+ | "0.2", | ||
+ | "0.25", | ||
+ | "0.33333333", | ||
+ | "0.4", | ||
+ | "0.5", | ||
+ | "0.625", | ||
+ | "0.76923076", | ||
+ | "1", | ||
+ | "1.3", | ||
+ | "1.6", | ||
+ | "2", | ||
+ | "2.5", | ||
+ | "3.2", | ||
+ | "4", | ||
+ | "5", | ||
+ | "6", | ||
+ | "8", | ||
+ | "10", | ||
+ | "13", | ||
+ | "15", | ||
+ | "20", | ||
+ | "25", | ||
+ | "30", | ||
+ | "60"]; | ||
+ | |||
+ | for (var i=0; i<expTimes.length; i++) { | ||
+ | logMessage("Capturing image: " + (i+1)); | ||
+ | captureImage(cameraName, "shutterSpeed:" + expTimes[i]); | ||
+ | waitMilliseconds(5000); // give the camera some time for capturing. The Theta needs between 5 to 8 seconds! | ||
+ | } | ||
+ | logMessage("Done"); | ||
+ | } | ||
+ | else showMessageDialog("Error", "No camera found"); | ||
+ | </code> |