Controller (v1.3.3) for tethered DSLR cameras using digiCamControl app.
C = CameraController -create class
C = CameraController(dcc) -digiCamControl location
C = CameraController(dcc,debug) -set debug level
dcc: digiCamControl's webserver IP or CMD remote utility folder.
If empty this class tests the default webserver, 'localhost:5513', then
default app install locations, 'C:\Program Files (x86)\digiCamControl'.
debug: 0=silent, 1=minimal (default), 2=print requests, 3=print replies
-This class uses digiCamControl (windows only app) to control supported
cameras: set ISO, exposure, focus, aperture(fnumber), white balance,
stream liveview, capture photos & video, configure file download, etc.
-digiCamControl is a multi purpose, free, open source, Windows only
application that can control a host of supported cameras.
1.Install and start digiCamControl v2.1.0 or greater:
2.Enable webserver: File>Settings>Webserver>Enable> RESTART APP
3.Connect one or more cameras using USB cable (or WiFi if supported?).
4.For full programmatic control set camera to (M) and lens to (MF).
5.Use digiCamControl app to ensure camera is working.
-This class communicates with camera(s) via digiCamControl's included
webserver(recommended) or CMD Utility.
-The webserver is much faster and allows camera(s) to be controlled from
any Windows/Linux computer on the network or via the internet.
-Visit http://digiCamControl.com for documentation, forums and to donate.
-Method in this class are Capitalised and have additional descriptions.
-When this class is created it does a one-off retrieval of allowed camera
options. Reinitialise this class when swapping cameras.
-This class can only stream liveview (low-rez, noisy, ~15Hz) from
supported cameras. However digiCamControl does support "Open Broadcaster
Software" (OBS) and "XSplit", see Streaming and Search Forums for info.
-Non-alphanumeric characters found in some Nikon camera properties are
being removed. These properties can be read but cannot be set.
eg "-", "." in "center-weighted_area" "active_d-lighting" "long_exp._nr"
-digiCamControl issues: http://digicamcontrol.com/phpbb/viewforum.php?f=4
-Focus method does not know how long it needs to wait after a focus change
is requested, see Focus method help to set custom delays.
-LiveView can only be 'streamed' when using the webserver.
-Some settings will not have affect if camera is not in Manual mode (M).
-To control focus ensure lens is set to Manual Focus (MF):
-Focus step size & speed can be modified in: File>Settings>Live view
-Note: Lenses use servo motors which have no discrete physical 'steps'. To
achieve a specific focus reproducibly try to go to the lens's physical
limit, in either direction, and apply the same 'steps' from there.
-To reduce capture latency from 0.3-0.6 sec to ~0.05s ensure webserver is
enabled, File>Settings>Webserver>Enable>RESTART APP
-To measure delay and variance try imaging the computer's own clock by
calling the Clock method provided with this class, C.Clock, however
I do not know how to measure monitor display latency and variance.
-Cmd('CaptureAll') will trigger all connected cameras but there will be a
lag of 0.005-0.020 sec between consecutive cameras.
-To record video turn on live preview using Cmd('LiveViewWnd_Show') and
user Cmd('StartRecord') and Cmd('StopRecord').
-Download is affected by Transfer mode (in app) and session settings.
-Transfer mode is set via the main app to: PC & Camera | Camera only, if
set to Camera only some session settings will be ignored. Set it to PC
& Camera and use session setting "deletefileaftertransfer" if needed.
-session setting "filenametemplate" works only if "useoriginalfilename" is
disabled, and it is applied to downloaded files only, not camera files.
It supports many useful [tags], eg: [Date yyyy-MM-dd], [Time hh-mm-ss],
[Date yyyy-MM-dd-hh-mm-ss], [Exif.Photo.ExposureTime],
[Exif.Photo.FNumber], [Exif.Photo.ISOSpeedRatings], etc
(for a full list go to: Session>Edit Current Session>File Name Template)
-"filenametemplate" can be set when calling the Capture method and applies
to all connected cameras. To distinguish cameras use [Camera Name] or
[Camera Counter 4 digit] tags in the template.
-"folder" does not support [tags], instead use "\" in "filenametemplate".
-Manual download of files from the camera can only be done via the app.
C = CameraController; %initialise
C.session.folder = 'C:\DSLR'; %download settings
C.session.filenametemplate = '[Camera Name]\[Date yyyy-MM-dd-hh-mm-ss]';
C.camera.isonumber = 3200; %camera settings
C.camera.fnumber = 5.6;
C.camera.shutterspeed = 1/200;
C.lastfile %last filename
Serge (2022). CameraController (https://github.com/serg3y/MatLab-digiCamControl), GitHub. Retrieved .
MATLAB Release Compatibility
Platform CompatibilityWindows macOS Linux
- Test and Measurement > Image Acquisition Toolbox > Device Connection >
- Test and Measurement > Image Acquisition Toolbox > Image Acquisition Toolbox Supported Hardware >
- MATLAB > Graphics > Formatting and Annotation > 3-D Scene Control > Camera Views >
- MATLAB > Graphics > Formatting and Annotation > 3-D Scene Control > Lighting, Transparency, and Shading >
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!Start Hunting!