-
Notifications
You must be signed in to change notification settings - Fork 4.8k
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
Hardware synchronization of multiple cameras #3504
Comments
We don’t currently have a genlock mode but we have a HW sync. This means that you have one master and all others are slave. Whether you use one pc or multiple, once they are connected and activated they will all acquire at exactly same time. In this case the remaining challenge is “lining them up”. I recommend using the frame counters. They offer many benefits. Once you have lined them up once they should stay aligned (basically offset each counter differently). It also allows you to track missing frames. |
Thanks for your response, @agrunnet!
I'm running some experiments to see if this strategy works. Hardware: I have four cameras running at low resolution at 90 Hz. I have a super bright LED that I turned on for ~2 seconds at 30 second intervals for ~10 minutes. The cameras are hooked up via cabling described in the white paper. I'm recording the voltage at the same time, so the signal is properly being sent. frames = device.pipeline.wait_for_frames()
framecount = frames.get_frame_number()
timestamp = frames.get_timestamp() Analysis: I take the mean brightness for every frame, and threshold this to turn it into a square wave. The raw and cleaned data look like this:
In my experiment, the frame counter drifted over time. If they were still aligned, the difference between cameras' frame counters to a flash of light should be constant over time, but rather it drifts. I don't see the drift in the timestamps described in the white paper. If the timestamps are correct, then I can just use them because they are only off by a maximum of ~100ms, and there's no constant drift over time. If the frame count is correct, then ~10 minutes into recording the cameras have drifted by ~140 frames, or 1.5 seconds, and there's no way to tell when these drifts occurred. |
You don’t currently see the time stamps drift? Then that means they are not slaved to each other. You do have the cables attached properly? |
I'm successfully reading a voltage signal from an attached DAQ board, but I'll verify the cabling today.
What steps do you mean?
|
@jbohnslav I'm stumped by the same issue as you, I'm unable to see a drift in the timestamps. Have you verified your cabling and concluded that it was a faulty circuit that was causing this? |
Hi @jbohnslav, |
Issue Description
I have multiple RealSense devices on one computer, and I would like to precisely synchronize the capture of all cameras with an external synchronization signal. It's very important for my application to know when each camera's exposure occurs, as I'm synchronizing the capture with other, non-realsense devices.
In traditional camera hardware, the "strobe" (or voltage signal indicating exposure or frame capture) is independent from the "trigger." This means that it's possible to both measure when frame capture occurred, and to manually trigger capture at any arbitrary time. Here is an example from Point Grey. You can also look at section 6.4.3 of a Basler camera for an example of a hardware trigger. I would like to hardware trigger my RealSense cameras--acquire an image when a voltage pulse is detected.
I thought that setting the camera to "slave" as follows would enable hardware triggering:
However, the camera still acquires data in the absence of a hardware trigger. It appears that in "slave" mode, if the camera does not detect a voltage signal, it acquires according to its own internal clock. This is quite confusing behavior. The following other issues relate to this:
#2295
#2148
#2179
I want to know the exact timing of each camera's acquisition. If it is truly impossible to hardware trigger the realsense, I can see two options:
TL;DR: I would like the camera to only acquire when a voltage signal was sent via pin 5. If this is not possible, does the camera trigger still fire if a frame was dropped?
The text was updated successfully, but these errors were encountered: