From 9417fe8d7f6c32cc5595a004b0828578ad234397 Mon Sep 17 00:00:00 2001 From: Moses Turner Date: Mon, 21 Mar 2022 18:05:17 -0500 Subject: [PATCH] a/tracking: Support different numbers of calib parameters --- src/xrt/auxiliary/tracking/t_data_utils.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/xrt/auxiliary/tracking/t_data_utils.c b/src/xrt/auxiliary/tracking/t_data_utils.c index 8a190dd1d..fa493f3c5 100644 --- a/src/xrt/auxiliary/tracking/t_data_utils.c +++ b/src/xrt/auxiliary/tracking/t_data_utils.c @@ -120,7 +120,9 @@ dump_distortion(struct t_camera_calibration *view) void t_stereo_camera_calibration_alloc(struct t_stereo_camera_calibration **out_c, uint32_t distortion_num) { - assert(distortion_num == 5 || distortion_num == 14); + // Four parameters for kannala-brandt, 5, 8, 12, or 14 for the normal OpenCV pinhole distortion model + assert(distortion_num == 4 || distortion_num == 5 || distortion_num == 8 || distortion_num == 12 || + distortion_num == 14); struct t_stereo_camera_calibration *c = U_TYPED_CALLOC(struct t_stereo_camera_calibration); c->view[0].distortion_num = distortion_num;