STIntrinsics Struct Properties


#1

Hello,

Your latest SDK has the STIntrinsic object which in the documentation is described as “This struct can be used to get the intrinsic parameters of the current DepthFrame.”. There is also one for the colorFrame.

The struct of that object is this:
typedef struct
{
_ int width, height;_
_ float fx, fy, cx, cy, k1, k2;_
} STIntrinsics;

I have a couple questions:

1-What is precisely the meaning of each of the struct’s properties? There is nothing on your site nor in the reference documentation describing these, and how they can be of use. I can only assume the meaning of some of these by looking on the web (such as this link https://www.mathworks.com/help/vision/ug/camera-calibration.html). Can you please describe the meaning of each of these properties?

2-When printing these properties in ‘sensorDidOutputSynchronizedDepthFrame:(STDepthFrame*)depthFrame colorFrame:(STColorFrame*)colorFrame’, the property values differ between the depthFrameand the colorFrame. Can you explain why?

Thanks,


#2

Additionally, in an attempt to validate the struct’s values and understand it better, I use the below formula (found online) to calculate the focal length in millimetres.

Formula:
F(mm) = F(pixels) * SensorWidth(mm) / ImageWidth (pixel)

An Apple framework outputs the below values for focal length, as well as sensor vertical aperture, and sensor aspect.

Focal length: 23.551325
Sensor vertical aperture: 24
Sensor aspect: 1.5

I presumed the ‘SensorWidth’ variable is the same as ‘horizontal aperture (mm)’. The horizontal aperture can be obtained by multiplying the vertical aperture by the aspect ratio. And so, using the formula, I obtain a focal length of 32 mm which is different than the one reported by the Apple framework.
F(mm) = F(pixels) * horizontal aperture (mm) / ImageWidth (pixel)
F(mm) = F(pixels) * (vertical aperture * aspect ratio) / ImageWidth (pixel)
F(mm) = 570.967102 * (24 * 1.5) / 640
F(mm) = 570.967102 * 36 / 640
F(mm) = 570.967102 * 36 / 640
F(mm) = 20,554.8157 / 640
F(mm) = 32

To try and find the bug, I calculated this new aspect ratio, which is the result of the frame width divided by frame length (as reported by the STIntrinsics struct). The focal length is still wrong.
F(mm) = 570.967102 * (24 * 1.3333333) / 640
F(mm) = 28.5483551