Motive 3D reconstruction

Post Reply
Damien
Posts: 3
Joined: Tue Jan 07, 2014 7:34 am

Motive 3D reconstruction

Post by Damien »

Hi,

I need some explanations about Motive and how it constructs 3D positions from camera data.
I tried to put a single marker exactly in the image center of the middle camera of my V120 Trio.

In these shots, the marker size in the 3d view is 2mm.

Top view
image1.png
image1.png (161.17 KiB) Viewed 5559 times
Left view
image3.png
image3.png (161.84 KiB) Viewed 5559 times
image4.png
image4.png (145.79 KiB) Viewed 5559 times
With this device Tracking Tools API gives me an orientation matrix equivalent to identity for the middle camera and location at origin (0,0,0).

In my opinion, the marker position should be exactly on the Z axis since there is no distortion at the center of the lens and the camera has no rotation matrix.

As you can see it is very surprising that the ray displayed by Motive is not aligned with the Z axis of the coordinate system. I don't understand when there is a significant deviation.
Motive gives (-0.0045, -0.0068, -0.604) as marker coordinates.
Does anyone have any idea to explain this ?

Thanks for your help.
beckdo
Posts: 520
Joined: Tue Jan 02, 2007 2:02 pm

Re: Motive 3D reconstruction

Post by beckdo »

Ok, there are a few things going on here.

First off, the middle camera is pointing right down the Z axis. Your reasoning is very good regarding this and where the ray should project but there are a few slight details that are also important to note. If you could put the 2D centroid exactly at 320,240 it's ray would not project directly down Z and would be slightly affected by lens distortion.

The actual imager inside each camera is quite small and there are manufacturing tolerances in play both in the physical location of the imager and the lens mounted directly over the top of it. As a result, the optical center does not land exactly at 320x240.

As part of the factory calibration, this offset is measured and compensated for in the camera calibration. The result is that if you put a 2D centroid exactly at 320x240 there is a slight impact from the lens distortion component that will move it slightly away from pointing straight down the Z axis.
Damien
Posts: 3
Joined: Tue Jan 07, 2014 7:34 am

Re: Motive 3D reconstruction

Post by Damien »

Thanks for your answer beckdo,

I do some test with Camera SDK and call the Core::Undistort2DPoint() function with (320, 240) coordinate and it gives me the same result (320, 240).

I tried the same operation with Tracking Tools API and the coordinate is a bit corrected, so it seams that Camera SDK does'nt give the right distortion model.
Is there a way to retrieve the correct one from the device with Camera SDK ?
I didn't find a function in Tracking Tools API to retrieve the values of his distortion model.

Regards
Damien
Damien
Posts: 3
Joined: Tue Jan 07, 2014 7:34 am

Re: Motive 3D reconstruction

Post by Damien »

Another strange behavior with distortion...

I tried to overload the distortion model values given by Camera SDK by values i obtained with openCV calibration tools.

With this values, the lens center is a little bit translated (319.5, 239.5), but the result of Undistort2DPoint with the center (320, 240) position remains unchanged.

Her is my code

Code: Select all

camera->GetDistortionModel(_distortionModel);
_distortionModel.LensCenterX = 3.1950000000000000e+002;
_distortionModel.LensCenterY = 2.3950000000000000e+002;
_distortionModel.HorizontalFocalLength = 6.0380821940567773e+002;
_distortionModel.VerticalFocalLength = 6.0380821940567773e+002;
_distortionModel.KC1 = -1.4901385517121024e-001;
_distortionModel.KC2 = 4.7882355712945224e-001;
_distortionModel.KC3 = -1.2353360895907093e+000;

float x = 320, y = 240;
Core::Undistort2DPoint(getDistortionModel(), x, y);
Many thanks for your help
beckdo
Posts: 520
Joined: Tue Jan 02, 2007 2:02 pm

Re: Motive 3D reconstruction

Post by beckdo »

The Camera SDK only exposes a general distortion model that matches the default lens sold with the camera. Unfortunately, there is currently no access to the distortion model calculated during manufacturing.

In regards to the discrepancy, I believe it is a difference between where the origin of the pixel is. For example, does an individual pixel go from -0.5 to +0.5, or is it 0 to 1. As a result you're getting a half of pixel shift to compensate for that.
JeDi
Posts: 44
Joined: Thu Mar 10, 2011 3:59 am

Re: Motive 3D reconstruction

Post by JeDi »

After filling in the distortion model, I think you have to do a SetDistortionModel to actually set it on the camera.

For the NaturalMotion staff: is exposing the calibrated distortion model (through the camera SDK object or through a TT API call) on the roadmap? We are also a bit stuck in our experiments due to not knowing these...
beckdo
Posts: 520
Joined: Tue Jan 02, 2007 2:02 pm

Re: Motive 3D reconstruction

Post by beckdo »

The distortion model is provided in the Camera SDK as a helper for the user. The distortion model is not applied to data coming out of the camera automatically.

Typically you would fetch each X & Y coordinate from each camera's frame as you iterate through the objects. The easiest way is to use the distortion model to undistort the X,Y coodinates immediately after you fetch them.

It's not on our roadmap currently to expose the measured distortion model. Please contact support with your interest for that feature as well as information regarding your application and why it's critical.
Post Reply