Commit 67d33550 authored by Jakob Bornecrantz's avatar Jakob Bornecrantz

t/calib: Change how default arguments are applied

parent 8564bbec
Pipeline #98412 passed with stages
in 5 minutes and 44 seconds
......@@ -299,29 +299,6 @@ t_psvr_create(struct xrt_frame_context *xfctx,
*
*/
#define T_CALIBRATION_DEFAULT_PARAMS \
{ \
false, T_BOARD_CHECKERS, \
{ \
9, 7, 0.025f, true, 5, \
}, \
{ \
9, \
7, \
0.025f, \
}, \
{ \
5, \
17, \
0.02f, \
}, \
{ \
false, \
20, \
}, \
20, 5, 20, 1, false, true \
}
/*!
* Board pattern type.
*/
......@@ -399,6 +376,47 @@ struct t_calibration_params
bool save_images;
};
/*!
* Sets the calibration parameters to the their default values.
*/
static inline void
t_calibration_params_default(struct t_calibration_params *p)
{
p->use_fisheye = true;
p->pattern = T_BOARD_CHECKERS;
// Checker board.
p->checkers.cols = 9;
p->checkers.rows = 7;
p->checkers.size_meters = 0.025f;
p->checkers.subpixel_enable = true;
p->checkers.subpixel_size = 5;
// Symmetrical circles.
p->circles.cols = 9;
p->circles.rows = 7;
p->circles.distance_meters = 0.025f;
// Asymmetrical circles.
p->asymmetric_circles.cols = 5;
p->asymmetric_circles.rows = 7;
p->asymmetric_circles.diagonal_distance_meters = 0.02f;
// Loading of images.
p->load.enabled = false;
p->load.num_images = 20;
// Frame collection info.
p->num_cooldown_frames = 20;
p->num_wait_for = 5;
p->num_collect_total = 20;
p->num_collect_restart = 1;
// Misc.
p->mirror_rgb_image = false;
p->save_images = true;
}
/*!
* @brief Create the camera calibration frame sink.
*
......
......@@ -275,16 +275,14 @@ gui_scene_calibrate(struct gui_program *p,
{
struct calibration_scene *cs = U_TYPED_CALLOC(struct calibration_scene);
#ifdef XRT_HAVE_OPENCV
struct t_calibration_params def = T_CALIBRATION_DEFAULT_PARAMS;
cs->params = def;
#endif
cs->base.render = scene_render_select;
cs->base.destroy = scene_destroy;
cs->xfctx = xfctx;
cs->xfs = xfs;
cs->mode = mode;
#ifdef XRT_HAVE_OPENCV
t_calibration_params_default(&cs->params);
#endif
gui_scene_push_front(p, &cs->base);
}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment