Apply delay in synchronization

maikelnai
Posts: 21
Joined: Thu May 22, 2014 1:25 am

Re: Apply delay in synchronization

Post by maikelnai »

Hello Steven,

we have implemented a class derived of the CameraLibrary::cCameraListener so we receive in its callback (FrameAvailable()) the new frames. We create an object of that class for each one of the cameras.

At the beginning of the method FrameAvailable(), we ask the OS for a time counter:

Code: Select all

void CCameraOptiTrackSDK_170_Final::FrameAvailable(){

	/// Get the instant
	LARGE_INTEGER CurrentInstant;
	QueryPerformanceCounter(&CurrentInstant);
        ...

At the end of the method, the information of the frame including the time counter, is passed to a global method where frames from all cameras are processed. At this moment, using the time counter from each frame, we can calculate the delay between the cameras:

Code: Select all

/// Get the elapsed time
	double elapsedTime = double((1000 * ( NewTime.QuadPart - m_counterCurrentFrame.QuadPart ) / double(m_counterFreq.QuadPart))  );


Where NewTime is the time counter of the new frame, m_counterCurrentFrame the time counter of the previous frame and m_counterFreq is a frequency value of the system:

Code: Select all

QueryPerformanceFrequency(&m_counterFreq);
Regards,
maikelnai
Posts: 21
Joined: Thu May 22, 2014 1:25 am

Re: Apply delay in synchronization

Post by maikelnai »

Hello Steven,

you are right, the problem is the exposure.
For the minimum exposure (10) the maximum delay is 2395 us.
For the maximum exposure (4800) the maximum delay 0 us.
Because we are using an exposure of 3447, the maximum delay is 676.5 us, very close to the value that I was obtaining. (setting 200 as Framerate)

The problem is that we need that exposure, but also we need 2500 us of delay. Exists any way (external synchro, different firmware...) to obtain that values? For the Flex3 cameras, using the Optihub, we achieve delays of 7500 us.

Regards,
steven.andrews
NaturalPoint Employee
NaturalPoint Employee
Posts: 720
Joined: Mon Jan 19, 2015 11:52 am

Re: Apply delay in synchronization

Post by steven.andrews »

Hello maikelnai,

You can access the high performance timer through the Camera SDK rather than query it directly. If you use CameraLibrary::CameraManager::X().TimeStamp(), it will return a time value in seconds of type double.
You can also call Frame->TimeStamp() to get a high performance time value (in seconds). The time is stamped on the frame the moment it is received over network sockets or USB at the earliest possible moment right as the data is received.

It sounds like what you are trying to achieve is to offset the exposures of two cameras from one another. Because the camera exposure time is centered in each frame period, the ability to apply larger offsets gets diminished as longer exposures are used. For the Slim 13E, the value can be negative, so one camera could be shifted to the left, and the other to the right, which helps to increase the delta between them.

If the long exposure value you wish to use is just to increase the image brightness, you could try increasing the imager gain to produce a brighter image, and this would allow for a smaller exposure value which in turn would allow for a larger shutter delay.

Cheers,
Steven
--
Steven Andrews
OptiTrack | Customer Support Engineer
maikelnai
Posts: 21
Joined: Thu May 22, 2014 1:25 am

Re: Apply delay in synchronization

Post by maikelnai »

Hello Steven,

yes, my target is to delay the exposure between the cameras to achieve a 400 Hz system instead of 200 Hz.

I have not understood the negative value; which parameter can setted with a negative value? Exposure min value is a positive ineteger, is the shutter delay the value that can be negative?

Regards,
steven.andrews
NaturalPoint Employee
NaturalPoint Employee
Posts: 720
Joined: Mon Jan 19, 2015 11:52 am

Re: Apply delay in synchronization

Post by steven.andrews »

Hi maikelnai,

That is correct. The Shutter Offset / delay can be negative for all Prime cameras and the Slim 13E.

Cheers,
Steven
--
Steven Andrews
OptiTrack | Customer Support Engineer
maikelnai
Posts: 21
Joined: Thu May 22, 2014 1:25 am

Re: Apply delay in synchronization

Post by maikelnai »

Dear Steven,

Yesterday I test it with negative values for the ShutterDelay.

Setting a value of 100 in the exposure, we achieve a good delay between the cameras very close of 2500 us
Setting a value of 960 in the exposure, the delay in one camera is 2400 us and 2600 us in the other.
And setting a value of 1440 in the exposure, the delay in one camera is 1800 us and 3200 us in the other.

Our target exposure value is 2900, and for this value, the achieved delay is not correct.


Do you think is possible to change the firmware of the cameras to achieve out target of delay and exposure?
Exists any other way?

Regards.
steven.andrews
NaturalPoint Employee
NaturalPoint Employee
Posts: 720
Joined: Mon Jan 19, 2015 11:52 am

Re: Apply delay in synchronization

Post by steven.andrews »

Hi maikelnai,

Our engineers have volunteered the following information.


At 200 FPS:

Camera1 : EXP = 2400, ShutterOffset = -1200
Camera2 : EXP = 2400, ShutterOffset = 1200

would result in the mid-point of the camera exposures being offset by 2400, and provides for a 2400 us exposure time


Can an increase in the imager gain be used to compensate for the fact that the exposure is less than 2900?

If a 2900 us exposure is a requirement, then the maximum frame rate allowed would be 166 FPS, using shutter offsets of -1450 and 1450.


Cheers,
Steven
--
Steven Andrews
OptiTrack | Customer Support Engineer
maikelnai
Posts: 21
Joined: Thu May 22, 2014 1:25 am

Re: Apply delay in synchronization

Post by maikelnai »

For this cameras, the exposure values units are us?

Regards,
steven.andrews
NaturalPoint Employee
NaturalPoint Employee
Posts: 720
Joined: Mon Jan 19, 2015 11:52 am

Re: Apply delay in synchronization

Post by steven.andrews »

Hi maikelnai,

That is correct. The values should be in us.

Cheers,
Steven
maikelnai
Posts: 21
Joined: Thu May 22, 2014 1:25 am

Re: Apply delay in synchronization

Post by maikelnai »

Do you think is possible to change your firmware to obtain our target with the Slim13E cameras?

Regards
Post Reply