isl-org / Open3D

Open3D: A Modern Library for 3D Data Processing
http://www.open3d.org
Other
11.55k stars 2.32k forks source link

Azure kinect intrinsic json structure (question) #1823

Closed Fred3D-tech closed 2 years ago

Fred3D-tech commented 4 years ago

Hello, I’m using open3d and several azure kinect cameras with other programs. I’m able to generate an intrinsic json file like this one:

{
“color_mode” : “MJPG_3072P”,
“depth_mode” : “NFOV_UNBINNED”,
“height” : 3072,
“intrinsic_matrix” :
[
1959.37890625,
0.0,
0.0,
0.0,
1958.880126953125,
0.0,
2044.2911376953125,
1565.8837890625,
1.0
],
“serial_number_” : “000266700112”,
“stream_length_usec” : 2666689,
“width” : 4096
}

Then I need to understand the stucture of it to get these values: Focals (pixels) - Fx:, Fy Optical center - Cx:, Cy: anf k1, k2, k3, p1,p2 and skew

by a opencv calibration I think I am able by deduction to get this about the structure:

“color_mode” : “MJPG_3072P”,
“depth_mode” : “NFOV_UNBINNED”,
“height” : 3072,
“intrinsic_matrix” :
[
1959.37890625, —> Fx
0.0, —> k1 ?
0.0, —> k2?
0.0, —> k3?
1958.880126953125, —> Fy
0.0, —> ???
2044.2911376953125, —> Cx
1565.8837890625, —> Cy
1.0 —> ???
],
“serial_number_” : “000266700112”,
“stream_length_usec” : 2666689,
“width” : 4096
}

then the value I can guess:

Focals (pixels) - Fx: 1959.37890625 Fy: 1958.880126953125 Optical center - Cx: 2044.2911376953125 Cy: 1565.8837890625 Radial distortion (Brown’s Model) K1: 0.0 K2: -0.0 K3: 0 P1: 0.0 P2: -0.0 Skew: 0

thanks a lot to give me the structure of the json file.

LuyaooChen commented 4 years ago

you can see this in k4atypes.h:

typedef union
{
    /** individual parameter or array representation of intrinsic model. */
    struct _param
    {
        float cx;            /**< Principal point in image, x */
        float cy;            /**< Principal point in image, y */
        float fx;            /**< Focal length x */
        float fy;            /**< Focal length y */
        float k1;            /**< k1 radial distortion coefficient */
        float k2;            /**< k2 radial distortion coefficient */
        float k3;            /**< k3 radial distortion coefficient */
        float k4;            /**< k4 radial distortion coefficient */
        float k5;            /**< k5 radial distortion coefficient */
        float k6;            /**< k6 radial distortion coefficient */
        float codx;          /**< Center of distortion in Z=1 plane, x (only used for Rational6KT) */
        float cody;          /**< Center of distortion in Z=1 plane, y (only used for Rational6KT) */
        float p2;            /**< Tangential distortion coefficient 2 */
        float p1;            /**< Tangential distortion coefficient 1 */
        float metric_radius; /**< Metric radius */
    } param;                 /**< Individual parameter representation of intrinsic model */
    float v[15];             /**< Array representation of intrinsic model parameters */
} k4a_calibration_intrinsic_parameters_t;

but there are 15 params, how do you generate your json file?

tostercx commented 3 years ago

I believe the intrinsic matrix is just this:

https://github.com/intel-isl/Open3D/blob/3b0134c50f4877dc079880e2199348bd853c1204/cpp/open3d/camera/PinholeCameraIntrinsic.h#L117-L122

So focal length + principal point, no distortion seems to be accounted for if I'm reading it right :/

theNded commented 2 years ago

It is simply [[fx, 0, 0], [0, fy, 0], [cx, cy, 1]]. Open3D at current does not support other parameters in the pinhole camera model (esp. for the downstream applications) so the rest have been ignored.