Camera Synchronization

leith
Posts: 194
Joined: Tue Jan 02, 2007 2:17 pm

Re: Camera Synchronization

Post by leith »

Thanks guys. I'm going to happily keep coding along then.
Queeny
Posts: 26
Joined: Tue Jun 03, 2008 10:06 am

Re: Camera Synchronization

Post by Queeny »

Hello,
I am using SDK 1.1034 and Flex120 cameras, I am confused about under what circumstances and when to call the synchronize function.

Also, I tried connecting my cameras to a properly functioning USB, but the cameras don't work that way.

What could be the problem?

Thanks!
Birch
Posts: 1139
Joined: Thu Jan 30, 2003 5:00 am
Location: Corvallis, Oregon

Re: Camera Synchronization

Post by Birch »

The synchronize call is deprecated in the current release of the OptiTrack SDK. It was cumbersome, so the V100 was changed to do it automatically in hardware. We did not make the change for the C120.

You might try older versions of the SDK if you want to use it for C120s (like version 1.1.030). It is only necessary if you want to have two cameras expose at the same point in time and track that using their matching Frame-IDs.

http://www.naturalpoint.com/optitrack/s ... chive.html
Queeny
Posts: 26
Joined: Tue Jun 03, 2008 10:06 am

Re: Camera Synchronization

Post by Queeny »

Hi again,

I figured out how to use the USB, it was a silly mitake.

In your reply you said:
"It is only necessary if you want to have two cameras expose at the same point in time and track that using their matching Frame-IDs."

when you say "that", do you mean the time?

I actually do want to expose 6 cameras, and track a marker/s at the same point in time because I hope to use this data to create my own 3-D tracking algorithm.

any suggestions?

Thanks!
Birch
Posts: 1139
Joined: Thu Jan 30, 2003 5:00 am
Location: Corvallis, Oregon

Re: Camera Synchronization

Post by Birch »

[quote=kweenee]
In your reply you said:
"It is only necessary if you want to have two cameras expose at the same point in time and track that using their matching Frame-IDs."

when you say "that", do you mean the time?
[/quote]

Yes. By "that", I mean using the frame-IDs to cluster frames from different cameras together (in software) which were exposed at the same point in time. The cameras will need to have their sync cables wired up.

[quote=kweenee]
I actually do want to expose 6 cameras, and track a marker/s at the same point in time because I hope to use this data to create my own 3-D tracking algorithm.

any suggestions?
[/quote]

The sync cables and frame-IDs will definitely assist in aligning the sampling of the data. As for the rest, its a large undertaking!

If you decide that you don't want to implement the code to do all that yourself, it might be worth considering our Point Cloud or Rigid Body packages.
Queeny
Posts: 26
Joined: Tue Jun 03, 2008 10:06 am

Re: Camera Synchronization

Post by Queeny »

Hello,

I just want to be sure...To acheive my 6 camera project I need to use the SDK version 1.1030?

Also, it is my understanding that frames with no data are filtered and that the option NP_OPTION_SEND_EMPTY_FRAMES can be set to stop filtering. Can you show me how to do that? I am doing this:

camera->SetOption (NP_OPTION_SEND_EMPTY_FRAMES, TRUE);

but I do no think that this is working by the test that I am doing.

I have a framecounter that I increment whenever frame!=0 and when I compare the framecounter with the Id, they aren't the same (but they should be until #255 at least).

Thanks.
andriyp
Posts: 4
Joined: Fri Feb 22, 2008 5:50 pm

Re: Camera Synchronization

Post by andriyp »

Hi,
two questions regarding synchronization:
1) Is it possible to reset the frame IDs for all cameras simultaneously?
When we try do it, by calling Synchronize(), or by sending a sequence of commands NP_OPTION_RESET_FRAME_COUNT, in some cameras in the array the IDs are reset, but there will be 2-3 cameras, out of 6, in which the IDs are totally different from those of the rest.

2) Occasionally, the frames are lost (?). At the very beginning of the tracking, the IDs will differ by some constant, but over time the difference will grow. E.g. after 1000 frames, some cameras will skip 5-10 frames. It appears that there are cameras that are "slower". All of them are connected directly into a PC (that is, without any external hubs). Is there a way to minimize the lost frames?
We do use NP_OPTION_SEND_EMPTY_FRAMES=ON; and we also tried various timeout constants in GetFrame() function.
Thanks!
Birch
Posts: 1139
Joined: Thu Jan 30, 2003 5:00 am
Location: Corvallis, Oregon

Re: Camera Synchronization

Post by Birch »

[quote=kweenee]Hello,

I just want to be sure...To acheive my 6 camera project I need to use the SDK version 1.1030?

Also, it is my understanding that frames with no data are filtered and that the option NP_OPTION_SEND_EMPTY_FRAMES can be set to stop filtering. Can you show me how to do that? I am doing this:

camera->SetOption (NP_OPTION_SEND_EMPTY_FRAMES, TRUE);

but I do no think that this is working by the test that I am doing.

I have a framecounter that I increment whenever frame!=0 and when I compare the framecounter with the Id, they aren't the same (but they should be until #255 at least).

Thanks.

[/quote]

If you are using C120s and want to call synchronize(), then yes we recommend using the older 1.1030 SDK version 1.1030.

If you are using V100s, you would want the most recent SDK version since they have automatic synchronization without requiring the synchronize() call.

Yes, NP_OPTION_SEND_EMPTY_FRAMES = TRUE will tell the OptiTrack SDK to generate FrameAvailable callbacks even when no markers are found for in a frame. If you are operating in greyscale mode you might be getting some frame dropped due to corruption, and the NP_OPTION_SEND_FRAME_MASK option could be worth reviewing.

Your syntax looks ok, you might try explicitly setting the variant type as shown below. I tested it and it works with the latest SDK, but I did not have a chance to verify it against 1.1.030.

CComVariant eFrames;
eFrames.boolVal = B2VB(TRUE);
eFrames.vt = VT_BOOL;
hr = m_spCamera->SetOption(NP_OPTION_SEND_EMPTY_FRAMES, eFrames);
Birch
Posts: 1139
Joined: Thu Jan 30, 2003 5:00 am
Location: Corvallis, Oregon

Re: Camera Synchronization

Post by Birch »

[quote=qaz]Hi,
two questions regarding synchronization:
1) Is it possible to reset the frame IDs for all cameras simultaneously?
When we try do it, by calling Synchronize(), or by sending a sequence of commands NP_OPTION_RESET_FRAME_COUNT, in some cameras in the array the IDs are reset, but there will be 2-3 cameras, out of 6, in which the IDs are totally different from those of the rest.

2) Occasionally, the frames are lost (?). At the very beginning of the tracking, the IDs will differ by some constant, but over time the difference will grow. E.g. after 1000 frames, some cameras will skip 5-10 frames. It appears that there are cameras that are "slower". All of them are connected directly into a PC (that is, without any external hubs). Is there a way to minimize the lost frames?
We do use NP_OPTION_SEND_EMPTY_FRAMES=ON; and we also tried various timeout constants in GetFrame() function.
Thanks! [/quote]


1) It depends if you are using C120s. As mentioned in the other post, if you use C120s and build 1.1.030 then calling synchronize() should align the frame IDs for every camera. If they aren't aligned then it might be a good idea to check the sync connection between the cameras. Using newer builds with C120 cameras might result in the synchronize() call failing to align C120s properly.

If V100s are used, then the cameras should sync up automatically without user or software intervention.

2) If the cameras are drifting, then it sounds like the sync cables might not be hooked up? They should be checked to make sure that one camera is at the start of the chain and the cables are cascaded down to the last camera. The chain should not form a loop (master only has sync-out and last in chain only gets sync in).
andriyp
Posts: 4
Joined: Fri Feb 22, 2008 5:50 pm

Re: Camera Synchronization

Post by andriyp »

Yes, we are employing C120-s.

For now, we are using the newest release - Version 1.3.035. Maybe that is the cause.
Could something become "broken" if we roll back the SDK? Is it just the SDK, or the driver too?
Thanks!
Post Reply