More Synchronization
Posted: 05 August 2010 07:43 AM   [ Ignore ]
New Member
Rank
Total Posts:  21
Joined  2010-03-26

Hi.

I have soldered wires to the VSYNC and FSIN at the locations identified on the board of five cameras. I basically followed this tutorial, except that I was not able to get the desired signal from the R22 plate and instead went straight to the place indicated as VSYNC on the images on that site.

http://sszymczy.rootnode.net/index.php?menu=projects&submenu=webcamsync2&subsub=PS3Eye

I confirmed with an oscilloscope that the VSYNC output of the first and the fourth camera are synchronized (and the fifth camera didn’t survive my soldering :( )

Now let’s say i have two genlocked cameras and I have two grabber threads. My question is how do I know which of these frames belong together? this may sound like an uninformed question, but I am aware of the other synchronization threads, most notably this one:

http://codelaboratories.com/forums/viewthread/221/

Basically the CLEyeCameraGetFrameD() function blocks until a frame is received. I tried using the system clock of my computer to create a timestamp (and I know it is unreliable) at this point in time. Then I always used the two images of the cameras that has the closest of these timestamps. Example at 15 frames per second (guid of camera and time in milliseconds):

e9179624-f4fa-c9a0-ebd3-e3242cb09d04 1015
83094846-88a4-753c-ce5f-ff4c0d9f6df5   1031

83094846-88a4-753c-ce5f-ff4c0d9f6df5   1093
e9179624-f4fa-c9a0-ebd3-e3242cb09d04 1109

83094846-88a4-753c-ce5f-ff4c0d9f6df5   1172
e9179624-f4fa-c9a0-ebd3-e3242cb09d04 1172

e9179624-f4fa-c9a0-ebd3-e3242cb09d04 1234
83094846-88a4-753c-ce5f-ff4c0d9f6df5   1234

83094846-88a4-753c-ce5f-ff4c0d9f6df5   1297
e9179624-f4fa-c9a0-ebd3-e3242cb09d04 1312


Unfortunately it is accurate only up to about a tick of 1/60th of a second. When a lot of processing comes together with a frame rate of 30fps and more, this is was not reliable enough.

I am hoping any of your guys has an idea how I could find out which of these frames belong together in a reliable way when the system clock resolution is too low for the trick above?

Profile
 
 
Posted: 05 August 2010 08:44 AM   [ Ignore ]   [ # 1 ]
New Member
Rank
Total Posts:  21
Joined  2010-03-26

Okay, on windows QueryPerformanceCounter() gave better results,  but as soon as I start dropping frames, I’m still in trouble.

Profile
 
 
Posted: 11 August 2010 09:56 AM   [ Ignore ]   [ # 2 ]
New Member
Rank
Total Posts:  21
Joined  2010-03-26

If the above was a stupid question or if it has already been answered, I would appreciate a reference.

Meanwhile I noticed something funny: Sometimes the “slave” camera (I mean the one that gets the vsync output of the other camera as FSIN input) freezes after the first image. If I exchange the USB slots where they are plugged into the computer, that solves the issue. How come?

Profile
 
 
Posted: 11 August 2010 09:18 PM   [ Ignore ]   [ # 3 ]
Sr. Member
Avatar
RankRankRankRank
Total Posts:  162
Joined  2009-09-17

Hey aaichert I’ll bring this up to Alex he is has some insight on these topics, you may want to send him a PM as well.

Profile
 
 
Posted: 12 August 2010 04:31 AM   [ Ignore ]   [ # 4 ]
New Member
Rank
Total Posts:  21
Joined  2010-03-26

Thanks, I might put together all information on synchronization and put them in this forum when I figured it all out.

By the way, that’s what I am building
_II_RAMP1.jpg

Profile
 
 
Posted: 18 August 2010 06:10 AM   [ Ignore ]   [ # 5 ]
New Member
Rank
Total Posts:  21
Joined  2010-03-26

So, I’m talking to myself… still here are my tests with syncing the cameras to a signal generated somewhere else.

I used the NE555 with 0.1uF capacitor and a 47kOhm and a 1kOhm resistors to generate a signal of about 30Hz and a low time of (measured) 550microseconds. The PS3Eye Cameras synced to it when it was inverted, despite the high-time was more than 4times as long as the usual VSYNC output and the period was off by several ms. In other words, it is not so difficult to make the cameras sync to another device with slightly different frequency, and FSIN can take quite a bit of timing variation and still sync to a signal.

I was almost surprised how well all that worked.

So why does that matter? Well, you can’t just sync PS3Eye cameras to one another and flash a bunch of LEDs based on what you get on the VSYNC output of the cameras. You can also take a sync signal from another device and sync your cameras to that, and it’s not too difficult.

Sweet.

Profile
 
 
 
 


RSS 2.0     Atom Feed