Dear all,
I'm having a problem with the syncronization of the cameras. I'm using two Flex:V100R2 cameras connected to an OptiHub 2. In my application all works fine untill i ask for GetFrameGroup and LastFrameGroupMode to the CameraLibrary::cModuleSync object:
- LastFrameGroupMode() allways returns "None"
- GetFrameGroup(), allways returns "null"
I have being lookinf in the forum, more people has had the same problem but the solution has not been posted.
I'm running the application in a Windows 7 64 bits laptop.
Regards
GetFrameGroup return null
Re: GetFrameGroup return null
Dear maikelnai:
I have the problem with the syncronization too. The camera I use is Flex 13.
I have used 6 cameras. And when the application starts, the cameralist have 6 cameras too. But when I want to get framegroup, it always lost some frames. I try sometimes, I only get 1 or 5 frames.
Hope the exchanges.
I have the problem with the syncronization too. The camera I use is Flex 13.
I have used 6 cameras. And when the application starts, the cameralist have 6 cameras too. But when I want to get framegroup, it always lost some frames. I try sometimes, I only get 1 or 5 frames.
Hope the exchanges.
-
- Posts: 609
- Joined: Tue Mar 19, 2013 5:03 pm
Re: GetFrameGroup return null
Hey Guys,
I will have one of our developers take a look at this issue.
I will have one of our developers take a look at this issue.
Dustin
Technical Support Engineer
OptiTrack | TrackIR | SmartNav
Technical Support Engineer
OptiTrack | TrackIR | SmartNav
Re: GetFrameGroup return null
Hey guys,
Let me give you some more information regarding synchronization. I would suggest reviewing the FrameSynchronization sample.
The basic approach you should implement is to observe connected cameras in the CameraList. Once you have cameras in the CameraList, you should fetch pointers to those cameras using the CameraManager::X().GetCamera(...) function.
Once you have your cameras, you should create a synchronizer and add the cameras to that synchronizer....like this for example:
At this point, make sure to Start() all your cameras so they are outputting frame data. The synchronizer will automatically collect these frames from all the cameras into synchronized groups of frames (FrameGroups) that are synchronized in time.
You can listen for notifications from the synchronizer to know when a new frame is available, this will achieve the lowest latency. However, for simplicity you can simply fetch FrameGroups from the synchronizer without knowing if one is available. If you call sync->GetFrameGroup() it will return a pointer to a FrameGroup if one is available, or it will return NULL if one is not available. If you call GetFrameGroup() more often than 1/FrameRate, and you should, you can expect to receive NULLs as well as valid FrameGroup pointers. You'll only receive a FrameGroup pointer as often as 1/FrameRate and you will receive NULLs for the other calls to GetFrameGroup().
In almost all cases, calls to LastFrameGroupMode() should return FrameGroup::Hardware.
Let me give you some more information regarding synchronization. I would suggest reviewing the FrameSynchronization sample.
The basic approach you should implement is to observe connected cameras in the CameraList. Once you have cameras in the CameraList, you should fetch pointers to those cameras using the CameraManager::X().GetCamera(...) function.
Once you have your cameras, you should create a synchronizer and add the cameras to that synchronizer....like this for example:
Code: Select all
cModuleSync * sync = new cModuleSync();
for(int i=0; i<cameraCount; i++)
sync->AddCamera(camera[i]);
You can listen for notifications from the synchronizer to know when a new frame is available, this will achieve the lowest latency. However, for simplicity you can simply fetch FrameGroups from the synchronizer without knowing if one is available. If you call sync->GetFrameGroup() it will return a pointer to a FrameGroup if one is available, or it will return NULL if one is not available. If you call GetFrameGroup() more often than 1/FrameRate, and you should, you can expect to receive NULLs as well as valid FrameGroup pointers. You'll only receive a FrameGroup pointer as often as 1/FrameRate and you will receive NULLs for the other calls to GetFrameGroup().
In almost all cases, calls to LastFrameGroupMode() should return FrameGroup::Hardware.