Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GrabStrategy_LatestImageOnly question #7

Open
mflova opened this issue May 29, 2024 · 3 comments
Open

GrabStrategy_LatestImageOnly question #7

mflova opened this issue May 29, 2024 · 3 comments

Comments

@mflova
Copy link

mflova commented May 29, 2024

I would like to have two USB-based cameras synchronized. Currently I have a difference of 50ms as I am just acquiring images in a sequential manner with the default grab strategy. I have been reading about the PTP protocol but it is already discarded as this only applies to gigE-based cameras. Therefore it seems that the only option I have is using an external trigger (which I read here basler/pypylon#470). Before doing that, I was wondering about a specific grab strategy. This is GrabStrategy_LatestImageOnly.

My question is, when you do something like:

cameras.StartGrabbing(pylon.GrabStrategy_LatestImageOnly, pylon.GrabLoop_ProvidedByUser)

Is the signal that triggers the start of the image acquisition somehow "aligned"? Some points to give context about what I mean with this:

  • Is the signal sent to the cameras at the same time? If this is the case, it could be the chance that these images are slightly synced, right?
  • I am aware that this probably delegates the image acquisition to each camera, meaning that this "pseudo-sync" can drift over time since each camera will be using its own clock.
  • I do not need that the FPS are exact as long as both cameras are synced as much as possible without introducing much more complexity

Is there any other simpler approach without going with the hardware trigger? About the sync I need, I would be expecting something around 1ms ideally.

Thanks!

@sebastianbasler
Copy link

Hey mflova,

the best way to synchronized grabbing images of 2 cameras without using a hardware trigger would be a GigE camera using PTP and Scheduled Action Commands.

I don not know if you are already working with it, but you can try to work with SoftwareTrigger to trigger both cameras as parallel as possible. Therefore you need to configure the cameras for the triggered image acquisition with software trigger as trigger.
When you start the grabbing now, the cameras wait for the software trigger and immediately start the exposure if it is present.

However, i would still expect an unpredictable difference in the start of the exposure of both cameras, which depends on when the PC is actually working on the command (OS and CPU dependent I think).

But you may want to try it out to see if this is accurate enough for your application.

Sebastian

@thiesmoeller
Copy link
Collaborator

Do you need only one image pair?
Or a continuous stream of synchronous image pairs at e.g. 30 fps?

@mflova
Copy link
Author

mflova commented May 31, 2024

Hey mflova,

the best way to synchronized grabbing images of 2 cameras without using a hardware trigger would be a GigE camera using PTP and Scheduled Action Commands.

I don not know if you are already working with it, but you can try to work with SoftwareTrigger to trigger both cameras as parallel as possible. Therefore you need to configure the cameras for the triggered image acquisition with software trigger as trigger. When you start the grabbing now, the cameras wait for the software trigger and immediately start the exposure if it is present.

However, i would still expect an unpredictable difference in the start of the exposure of both cameras, which depends on when the PC is actually working on the command (OS and CPU dependent I think).

But you may want to try it out to see if this is accurate enough for your application.

Sebastian

Thanks for the tip. That was quite useful! I only have the USB cameras so I will have to work on those. In any case, it should be possible with the external trigger by using an electrical signal, right? I have been reading about it and at some point I might end up needing it

Do you need only one image pair? Or a continuous stream of synchronous image pairs at e.g. 30 fps?

I need multiple images paired. The fact that it ends up being even 31 fps or 29 fps due to inaccuracies of the OS is not a problem. It does not matter if the time between consecutive images is not constant. However, whenever I take one image I would like to know that the other one is as close as possible.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants