G
G
Gleb Igumnov2012-06-27 18:42:40
Qt
Gleb Igumnov, 2012-06-27 18:42:40

How to parallelize control of Canon cameras in EDSDK via QThread?

Good afternoon.
The situation is as follows - there are two Canon EOS550D cameras connected to the same computer, which you want to make take pictures as simultaneously as possible.
Management is carried out using EDSDK 2.10.
For this purpose, classes of threads based on QThread were created, the task of which is to send a photographing command to the camera and save the resulting image to disk.
When trying to start, if one camera cannot focus for some time, the second one does nothing, although the threads, judging by the issuance of debug messages, go honestly in parallel.
Is this a limitation of the SDK itself that cannot be bypassed or am I doing something wrong?

Answer the question

In order to leave comments, you need to log in

3 answer(s)
I
ixSci, 2012-06-27
@ixSci

For this, thread classes based on QThread were created.

At least this is it. This is not the correct threading approach in Qt.
Anyway, show me the code. How and where do you send the command.

G
Gleb Igumnov, 2012-06-27
@CrazySage

With parallelism in Qt, I just started to understand, maybe I really misunderstood something. It looks like this:
There are two thread objects in the control class, if you need to take a snapshot, the following function is called

void CameraController::testShot()
{
    leftCameraThread->setPath(path1);
    leftCameraThread->start();
    rightCameraThread->setPath(path2);
    rightCameraThread->start();
}

I removed any checks for the existence of objects here so as not to litter the message, path1 and path2 are the paths along which files will be saved in the future.
In a thread, run() looks like this:
void CameraControlThread::run()
{
  EdsSendCommand(_camera, kEdsCameraCommand_TakePicture , 0);
}

L
Limosha, 2012-08-12
@Limosha

It may be too late, but:
Your cameras must support the Picture Transfer Protocol, try to organize interaction through it. Here there are links to libraries for working with such cameras, there is also a console utility where you can test. There is also a Java library.
In addition, if you are working on OS X, there is a framework that allows you to work with PTP cameras, perform simple operations (take a picture) and send “raw” PTP commands to the device.
Through PTP (if the camera supports it), you can adjust shooting parameters such as shutter speed, aperture, sensitivity, etc.
For a demonstration of the possibilities, try Icarus Camera Control - sourceforge.net/projects/camctl/
Hope it helps.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question