40typedef struct cJSON cJSON;
54#define XRT_DISTORTION_MAX_DIM (14)
140static inline const char *
149 default:
U_LOG_E(
"Invalid distortion_model! %d", model);
return "INVALID";
169 default:
U_LOG_E(
"Invalid distortion_model! %d", model);
return 0;
179 double k1, k2, p1, p2, k3;
188 double k1, k2, p1, p2, k3, k4, k5, k6;
197 double k1, k2, p1, p2, k3, k4, k5, k6, s1, s2, s3, s4, tx, ty;
206 double k1, k2, k3, k4;
215 double k1, k2, p1, p2, k3, k4, k5, k6, codx, cody, rpmax;
299 if (old_dst == src) {
311 t_stereo_camera_calibration_destroy(old_dst);
443 uint8_t v[256][256][256][3];
459t_convert_in_place_y8u8v8_to_r8g8b8(uint32_t width, uint32_t height,
size_t stride,
void *data_ptr);
462t_convert_in_place_y8u8v8_to_h8s8v8(uint32_t width, uint32_t height,
size_t stride,
void *data_ptr);
465t_convert_in_place_h8s8v8_to_r8g8b8(uint32_t width, uint32_t height,
size_t stride,
void *data_ptr);
475#define T_HSV_STEP (256 / T_HSV_SIZE)
477#define T_HSV_DEFAULT_PARAMS() \
480 {165, 30, 160, 100}, \
481 {135, 30, 160, 100}, \
482 {95, 30, 160, 100}, \
514 uint8_t v[256][256][256];
519 uint8_t v[T_HSV_SIZE][T_HSV_SIZE][T_HSV_SIZE];
534 return t->v[y / T_HSV_STEP][u / T_HSV_STEP][v / T_HSV_STEP];
704 T_BOARD_ASYMMETRIC_CIRCLES,
738 bool subpixel_enable;
749 bool normalize_image;
756 float distance_meters;
763 float diagonal_distance_meters;
764 } asymmetric_circles;
772 int num_cooldown_frames;
774 int num_collect_total;
775 int num_collect_restart;
u_logging_level
Logging level enum.
Definition: u_logging.h:43
#define U_LOG_E(...)
Log a message at U_LOGGING_ERROR level, conditional on the global log level.
Definition: u_logging.h:304
t_board_pattern
Board pattern type.
Definition: t_tracking.h:699
t_slam_prediction_type
SLAM prediction type.
Definition: t_tracking.h:597
void t_slam_fill_default_config(struct t_slam_tracker_config *config)
Fills in a t_slam_tracker_config with default values.
Definition: t_tracker_slam.cpp:1495
int t_convert_yuv_or_yuyv_create(struct xrt_frame_sink *next, struct xrt_frame_sink **out_sink)
bool t_stereo_camera_calibration_save_v1(FILE *calib_file, struct t_stereo_camera_calibration *data)
Save the given stereo calibration data to the given file in v1 format (binary).
Definition: t_file.cpp:508
bool t_stereo_camera_calibration_load_v1(FILE *calib_file, struct t_stereo_camera_calibration **out_data)
Load stereo calibration data from a given file in v1 format (binary).
Definition: t_file.cpp:228
int t_debug_hsv_filter_create(struct xrt_frame_context *xfctx, struct xrt_frame_sink *passthrough, struct xrt_frame_sink **out_sink)
Definition: t_debug_hsv_filter.cpp:107
static const char * t_stringify_camera_distortion_model(const enum t_camera_distortion_model model)
Stringifies a t_camera_distortion_model.
Definition: t_tracking.h:141
#define XRT_DISTORTION_MAX_DIM
Maximum size of rectilinear distortion coefficient array.
Definition: t_tracking.h:54
bool t_stereo_camera_calibration_to_json_v2(cJSON **out_cjson, struct t_stereo_camera_calibration *data)
Convert the given stereo calibration data into a json object in v2 format.
Definition: t_file.cpp:607
int t_hsv_filter_create(struct xrt_frame_context *xfctx, struct t_hsv_filter_params *params, struct xrt_frame_sink *sinks[4], struct xrt_frame_sink **out_sink)
Construct an HSV filter sink.
Definition: t_hsv_filter.c:328
static size_t t_num_params_from_distortion_model(const enum t_camera_distortion_model model)
Returns the number of parameters needed for this t_camera_distortion_model to be held by an OpenCV Ma...
Definition: t_tracking.h:161
bool t_stereo_camera_calibration_load(const char *calib_path, struct t_stereo_camera_calibration **out_data)
Load stereo calibration data from a given file path.
Definition: t_file.cpp:812
int t_debug_hsv_viewer_create(struct xrt_frame_context *xfctx, struct xrt_frame_sink *passthrough, struct xrt_frame_sink **out_sink)
Definition: t_debug_hsv_viewer.cpp:168
void t_imu_calibration_dump(struct t_imu_calibration *c)
Small helper function that dumps the imu calibration data to logging.
Definition: t_data_utils.c:369
void t_inertial_calibration_dump(struct t_inertial_calibration *c)
Prints a t_inertial_calibration struct.
Definition: t_data_utils.c:360
void t_stereo_camera_calibration_dump(struct t_stereo_camera_calibration *c)
Small helper function that dumps the stereo calibration data to logging.
Definition: t_data_utils.c:138
bool t_stereo_camera_calibration_save(const char *calib_path, struct t_stereo_camera_calibration *data)
Save the given stereo calibration data to the given file path.
Definition: t_file.cpp:819
int t_debug_hsv_picker_create(struct xrt_frame_context *xfctx, struct xrt_frame_sink *passthrough, struct xrt_frame_sink **out_sink)
Definition: t_debug_hsv_picker.cpp:219
static void t_stereo_camera_calibration_reference(struct t_stereo_camera_calibration **dst, struct t_stereo_camera_calibration *src)
Update the reference counts on a stereo calibration data(s).
Definition: t_tracking.h:295
int t_calibration_stereo_create(struct xrt_frame_context *xfctx, const struct t_calibration_params *params, struct t_calibration_status *status, struct xrt_frame_sink *gui, struct xrt_frame_sink **out_sink)
Create the camera calibration frame sink.
void t_calibration_gui_params_default(struct t_calibration_params *p)
Sets the calibration parameters to the their default values.
Definition: t_data_utils.c:284
t_camera_distortion_model
The distortion model this camera calibration falls under.
Definition: t_tracking.h:63
void t_camera_calibration_dump(struct t_camera_calibration *c)
Small helper function that dumps one camera calibration data to logging.
Definition: t_data_utils.c:128
void t_stereo_camera_calibration_alloc(struct t_stereo_camera_calibration **out_c, const enum t_camera_distortion_model distortion_model)
Allocates a new stereo calibration data, unreferences the old data pointed to by out_c.
Definition: t_data_utils.c:112
bool t_stereo_camera_calibration_from_json_v2(cJSON *json, struct t_stereo_camera_calibration **out_stereo)
Parse the json object in v2 format into stereo calibration data.
Definition: t_file.cpp:436
@ T_BOARD_SB_CHECKERS
Sector based checker board, using cv::findChessboardCornersSB.
Definition: t_tracking.h:702
@ SLAM_PRED_IP_IO_IA_IL
Predicts from a pose that is the last SLAM pose with the IMU samples that came after it integrated on...
Definition: t_tracking.h:602
@ SLAM_PRED_SP_SO_SA_SL
Predicts from last two SLAM poses only.
Definition: t_tracking.h:599
@ SLAM_PRED_SP_SO_IA_SL
Predicts from last SLAM pose with angular velocity computed from IMU.
Definition: t_tracking.h:600
@ SLAM_PRED_NONE
No prediction, always return the last SLAM tracked pose.
Definition: t_tracking.h:598
@ SLAM_PRED_SP_SO_IA_IL
Predicts from last SLAM pose with angular and linear velocity computed from IMU.
Definition: t_tracking.h:601
@ T_DISTORTION_OPENCV_RADTAN_8
OpenCV's radial-tangential distortion model.
Definition: t_tracking.h:82
@ T_DISTORTION_OPENCV_RADTAN_5
OpenCV's radial-tangential distortion model.
Definition: t_tracking.h:73
@ T_DISTORTION_FISHEYE_KB4
Juho Kannalla and Sami Sebastian Brandt's fisheye distortion model.
Definition: t_tracking.h:116
@ T_DISTORTION_WMR
Windows Mixed Reality headsets' camera model.
Definition: t_tracking.h:131
@ T_DISTORTION_OPENCV_RADTAN_14
OpenCV's radial-tangential distortion model.
Definition: t_tracking.h:101
static XRT_CHECK_RESULT bool xrt_reference_dec_and_is_zero(struct xrt_reference *xref)
Decrement the reference and return true if the value is now zero.
Definition: xrt_defines.h:2025
static void xrt_reference_inc(struct xrt_reference *xref)
Increment the reference, probably want xrt_reference_inc_and_was_zero.
Definition: xrt_defines.h:1988
Definition: t_tracking.h:724
bool stereo_sbs
Is the camera a stereo sbs camera, mostly for image loading.
Definition: t_tracking.h:728
bool use_fisheye
Should we use fisheye version of the calibration functions.
Definition: t_tracking.h:726
enum t_board_pattern pattern
What type of pattern are we using for calibration.
Definition: t_tracking.h:730
bool mirror_rgb_image
Should we mirror the RGB image?
Definition: t_tracking.h:782
Definition: t_tracking.h:708
bool finished
Is calibration finished?
Definition: t_tracking.h:710
int num_collected
Number of frames collected.
Definition: t_tracking.h:714
struct t_stereo_camera_calibration * stereo_data
Stereo calibration data that was produced.
Definition: t_tracking.h:720
int waits_remaining
Number of non-moving frames before capture.
Definition: t_tracking.h:718
int cooldown
Number of moving frames before another capture.
Definition: t_tracking.h:716
bool found
Was the target found this frame?
Definition: t_tracking.h:712
Parameters for T_DISTORTION_FISHEYE_KB4.
Definition: t_tracking.h:205
Parameters for T_DISTORTION_OPENCV_RADTAN_14.
Definition: t_tracking.h:196
Parameters for T_DISTORTION_OPENCV_RADTAN_5.
Definition: t_tracking.h:178
Parameters for T_DISTORTION_OPENCV_RADTAN_8.
Definition: t_tracking.h:187
Parameters for T_DISTORTION_WMR.
Definition: t_tracking.h:214
Essential calibration data for a single camera, or single lens/sensor of a stereo camera.
Definition: t_tracking.h:223
double intrinsics[3][3]
Camera intrinsics matrix.
Definition: t_tracking.h:228
struct xrt_size image_size_pixels
Source image size.
Definition: t_tracking.h:225
enum t_camera_distortion_model distortion_model
Distortion model that this camera uses.
Definition: t_tracking.h:241
Definition: t_tracking.h:442
Definition: t_tracking.h:488
Definition: t_tracking.h:513
Definition: t_tracking.h:518
Parameters for constructing an HSV filter.
Definition: t_tracking.h:502
Combined IMU calibration data.
Definition: t_tracking.h:411
struct t_inertial_calibration accel
Accelerometer calibration data.
Definition: t_tracking.h:413
struct t_inertial_calibration gyro
Gyroscope calibration data.
Definition: t_tracking.h:416
Parameters for accelerometer and gyroscope calibration.
Definition: t_tracking.h:393
double bias_std[3]
Modeled sensor bias.
Definition: t_tracking.h:401
double noise_std[3]
Modeled measurement noise.
Definition: t_tracking.h:404
double offset[3]
Offset to apply to raw measurements.
Definition: t_tracking.h:398
double transform[3][3]
Linear transformation for raw measurements alignment and scaling.
Definition: t_tracking.h:395
Calibration information necessary for SLAM tracking.
Definition: t_tracking.h:636
struct t_slam_camera_calibration cams[XRT_TRACKING_MAX_SLAM_CAMS]
Calib data of cam_count cams.
Definition: t_tracking.h:638
int cam_count
Number of cameras.
Definition: t_tracking.h:639
struct t_slam_imu_calibration imu
IMU calibration data.
Definition: t_tracking.h:637
Extension to camera calibration for SLAM tracking.
Definition: t_tracking.h:613
struct xrt_matrix_4x4 T_imu_cam
Transform IMU to camera.
Definition: t_tracking.h:615
double frequency
Camera FPS.
Definition: t_tracking.h:616
Extension to IMU calibration for SLAM tracking.
Definition: t_tracking.h:625
SLAM tracker configuration.
Definition: t_tracking.h:648
bool features_stat
Enable feature metric in external system.
Definition: t_tracking.h:660
bool submit_from_start
Whether to submit data to the SLAM tracker without user action.
Definition: t_tracking.h:654
enum t_slam_prediction_type prediction
Which level of prediction to use.
Definition: t_tracking.h:656
const char * vit_system_library_path
Path to the VIT system library.
Definition: t_tracking.h:650
const char * csv_path
Path to write CSVs to.
Definition: t_tracking.h:658
int cam_count
Number of cameras in use.
Definition: t_tracking.h:652
int openvr_groundtruth_device
If >0, use lighthouse as groundtruth, see openvr_device.
Definition: t_tracking.h:655
enum u_logging_level log_level
SLAM tracking logging level.
Definition: t_tracking.h:649
const char * slam_config
Config file path, format is specific to the SLAM implementation in use.
Definition: t_tracking.h:651
bool write_csvs
Whether to enable CSV writers from the start for later analysis.
Definition: t_tracking.h:657
bool timing_stat
Enable timing metric in external system.
Definition: t_tracking.h:659
bool slam_ui
Whether to open the external UI of the external SLAM system.
Definition: t_tracking.h:653
Stereo camera calibration data to be given to trackers.
Definition: t_tracking.h:248
double camera_essential[3][3]
Essential matrix.
Definition: t_tracking.h:261
double camera_translation[3]
Translation from first to second in the stereo pair.
Definition: t_tracking.h:256
struct t_camera_calibration view[2]
Calibration of individual views/sensor.
Definition: t_tracking.h:253
double camera_rotation[3][3]
Rotation matrix from first to second in the stereo pair.
Definition: t_tracking.h:258
double camera_fundamental[3][3]
Fundamental matrix.
Definition: t_tracking.h:263
struct xrt_reference reference
Ref counting.
Definition: t_tracking.h:250
A 3 element colour with floating point channels.
Definition: xrt_defines.h:384
Object used to track all sinks and frame producers in a graph.
Definition: xrt_frame.h:108
A object that is sent frames.
Definition: xrt_frame.h:58
A tightly packed 4x4 matrix of floats.
Definition: xrt_defines.h:560
A base class for reference counted objects.
Definition: xrt_defines.h:96
Image size.
Definition: xrt_defines.h:409
Container of pointers to sinks that could be used for a SLAM system.
Definition: xrt_tracking.h:202
A single tracked PS Move controller, camera and ball are not synced.
Definition: xrt_tracking.h:218
A tracked PSVR headset.
Definition: xrt_tracking.h:260
An adapter that wraps an external SLAM tracker to provide SLAM tracking.
Definition: xrt_tracking.h:294
Basic logging functionality.
Common defines and enums for XRT.
Header defining the tracking system integration in Monado.