I got my
Canon EOS Digital Software Development Kit (ED-SDK 2.1) back in December but have not gotten much time to experiment with it. I wrote some quick-and-dirty program today just to test out the different SDK function calls. I opted to test with my Canon EOS 400D instead of the Digital IXUS 400 primarily because the
EOS Development Kit (EDK) already came with a C-Sharp wrapper called
EDSDK.cs. So I didn't have to download some other 3rd party library wrapper just to integrate with the CD-SDK.
The C Sharp wrapper bundled with the EDK is pretty basic. In fact, I would not really call it a
class in the OOP sense. Its more of like a traditional C
struct. It enumerates all the different constants and data structures supported by the EDK, which is a big help since I would not want to re-type that. The development library can be either statically linked through the provided
EDSDK.lib file, or by dynamic linking by referring to the
EDSDK.dll. The C Sharp class file uses the latter method (since I don't think there is any way of linking directly to a .lib file with C#). The
EDSDK.cs wrapper file provides the convenient function prototypes already also.
The program flow is very straightforward. You call
EdsInitializeSDK() to startup the library and
EdsTerminateSDK() to shut it down. Then in-between that's where you do all the neat stuffs -- like query the camera for its properties and settings; modify the settings; take a picture; go through the camera's storage system and retrieve images. The EDK pretty much lets you change all the settings that can be modified -- the ISO speed, AE mode, aperture, shutter speed, JPEG quality/compression level, and so much more. Anything that you can set using the camera's LCD menu, can be programmatically set as well. The EDK provides you with functions to lock the User Interface so that while the application is in control of the camera, it cannot be manually overridden by a human operator.
I think in theory you can connect multiple cameras to a PC via the provided USB cable and control them from a single application (
this setup of EOS cameras is pretty amazing). The EDK just mentions some notes about concurrency issues that might cause problems. In any case, I have no plans of attaching more than one camera so that should not be an issue. The SDK does provide you with functions to list the cameras attached, or are available, and lets you select which one you want to work with. Once you've selected your camera, you would open a session with it by calling
EdsOpenSession(). Then you would use the
EdsSendCommand() mainly to do everything else like doing a remote capture.
I've gotten as far as the following:
- Initialize the SDK
- Enumerate the cameras attached and select the 1st one (my EOS 400D in this case)
- Open a session with the camera
- Retrieve its settings and properties
- Perform a remote capture (aka. Take a Picture)
- Close the camera session
- Terminate the SDK
The images taken by step 5 currently remains on the camera. I have to do more experimentation next time on how to do image transfers from the camera to the PC. Of course, the SDK provides all of those functions as well. Its just a matter of figuring out how to use them correctly. I will need to define postback functions for sure. For now, I'm purely doing synchronous programming. However, the programming model that the Canon EDK uses is asynchronous and postback-based.