当前位置: 首页 > 工具软件 > Intrinsic > 使用案例 >

open3d + azure kinect获得相机的内参矩阵intrinsic

白翔
2023-12-01

#include <k4a/k4a.h>
#include<string>

int main()
{
    k4a_device_t device = NULL;
    uint8_t deviceId = K4A_DEVICE_DEFAULT;

    if (K4A_RESULT_SUCCEEDED != k4a_device_open(deviceId, &device))
    {
        printf("Failed to open device\n");
    }
    k4a_depth_mode_t depth_mode = K4A_DEPTH_MODE_WFOV_2X2BINNED;
    k4a_color_resolution_t resolute = K4A_COLOR_RESOLUTION_720P;
    k4a_calibration_t calibration;
    k4a_device_get_calibration(device, depth_mode, resolute, &calibration);
    k4a_calibration_intrinsics_t  parameters = calibration.color_camera_calibration.intrinsics;
    return 0;
}

最后得到的parameters 里面有fx,fy,cx,cy,结合resolution对应的宽高,可以用opencv求得相机内参intrinsic

intrinsic = o3d.camera.PinholeCameraIntrinsic(w,d,fx,fy,cx,cy)
 类似资料: