The open source OpenXR runtime
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

t/util: Add dump function for single camera calibration struct

authored by

Mateo de Mayo and committed by
Jakob Bornecrantz
31f71251 0268daff

+29 -11
+20 -10
src/xrt/auxiliary/tracking/t_data_utils.c
··· 80 80 } 81 81 82 82 static void 83 - dump_distortion(const char *prefix, struct t_camera_calibration *view) 83 + dump_distortion(struct t_camera_calibration *view) 84 84 { 85 85 char buf[1024]; 86 86 ssize_t curr = 0; 87 87 88 - U_LOG_RAW("%s.use_fisheye = %s", prefix, view->use_fisheye ? "true" : "false"); 88 + U_LOG_RAW("use_fisheye = %s", view->use_fisheye ? "true" : "false"); 89 89 90 90 if (view->use_fisheye) { 91 - P("%s.distortion_fisheye = [", prefix); 91 + P("distortion_fisheye = ["); 92 92 for (uint32_t col = 0; col < 4; col++) { 93 93 P("%f", view->distortion_fisheye[col]); 94 94 if (col < 3) { ··· 97 97 } 98 98 P("]"); 99 99 } else { 100 - P("%s.distortion = [", prefix); 100 + P("distortion = ["); 101 101 for (uint32_t col = 0; col < view->distortion_num; col++) { 102 102 P("%f", view->distortion[col]); 103 103 if (col < view->distortion_num - 1) { ··· 134 134 } 135 135 136 136 void 137 + t_camera_calibration_dump(struct t_camera_calibration *c) 138 + { 139 + U_LOG_RAW("t_camera_calibration {"); 140 + dump_size("image_size_pixels", c->image_size_pixels); 141 + dump_mat("intrinsic", c->intrinsics); 142 + dump_distortion(c); 143 + U_LOG_RAW("}"); 144 + } 145 + 146 + void 137 147 t_stereo_camera_calibration_dump(struct t_stereo_camera_calibration *c) 138 148 { 139 - dump_size("view[0].image_size_pixels", c->view[0].image_size_pixels); 140 - dump_mat("view[0].intrinsic", c->view[0].intrinsics); 141 - dump_distortion("view[0]", &c->view[0]); 142 - dump_size("view[1].image_size_pixels", c->view[0].image_size_pixels); 143 - dump_mat("view[1].intrinsic", c->view[1].intrinsics); 144 - dump_distortion("view[1]", &c->view[1]); 149 + U_LOG_RAW("t_stereo_camera_calibration {"); 150 + U_LOG_RAW("view[0] = "); 151 + t_camera_calibration_dump(&c->view[0]); 152 + U_LOG_RAW("view[1] = "); 153 + t_camera_calibration_dump(&c->view[1]); 145 154 dump_vector("camera_translation", c->camera_translation); 146 155 dump_mat("camera_rotation", c->camera_rotation); 156 + U_LOG_RAW("}"); 147 157 }
+9 -1
src/xrt/auxiliary/tracking/t_tracking.h
··· 149 149 } 150 150 151 151 /*! 152 - * Small helper function that dumps the calibration data to logging. 152 + * Small helper function that dumps one camera calibration data to logging. 153 + * 154 + * @relates t_camera_calibration 155 + */ 156 + void 157 + t_camera_calibration_dump(struct t_camera_calibration *c); 158 + 159 + /*! 160 + * Small helper function that dumps the stereo calibration data to logging. 153 161 * 154 162 * @relates t_stereo_camera_calibration 155 163 */