Recording from multiple cameras

Post Reply
jljbascones
Posts: 3
Joined: Wed Mar 26, 2008 5:01 am

Recording from multiple cameras

Post by jljbascones »

Hello,

I'm trying to get synchronized data from two V100 cameras. They are connected using the sync cable, and I call 'cameraCollection->Synchronize()' before start recording. I'm calling 'GetFrame' for each camera, but i'm having troubles getting the data. Here are my questions:
-how I know which frames from different cameras correspond to same time? Using the ID?
-using a single camera (calling 'Start' for only one of them), 'GetFrame' with 10 secs timeout works fine, but the soft crashes when using both cameras (calling 'Start' for both cameras)
-using a single camera, I get frames with consecutive IDs; using two cameras, some IDs are missing. Does this mean that I'm loosing frames?
-sometimes I get NULL frames calling GetFrame with INFINITE timeout. What does this means?

Some additional data:
-using W2K;
-using a Win32 console app developed with VC8;
-using 'SetOption(NP_OPTION_SEND_FRAME_MASK,(CComVariant)(NP_FRAME_SENDINVALID | NP_FRAME_SENDEMPTY))' for both cameras;
-code calling 'GetFrame' for two cameras:

for(i=0;iGetFrame(0,&frame);
if(frame!=NULL)
break;
Sleep(10);
};

long id=0, count;
frame->get_Id(&id);
printf("Frame ID: %d - %d\n",id,j);

frame->Free();
frame.Release();

};
};

Thank you in advance,

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

Re: Recording from multiple cameras

Post by Birch »

The synchronize() call should not be used for V100 cameras. Here is the comment from the docs :

4.1.1.2.3
INPCameraCollection::Synchronize
Note : This call is deprecated for OptiTrack V100 cameras as of SDK version 1.1.033. If the synchronization cables are connected, then the Frame IDs for V100 cameras will automatically synchronize without software intervention once the cameras are started.

[quote=jljbascones]
-how I know which frames from different cameras correspond to same time? Using the ID?
[/quote]

When the cameras are synchronized, then video frames exposed at the same point in time will have matching Frame IDs. It is the task of the application to group them into matching sets.

We will address the remaining questions in another post.
Post Reply