Monado OpenXR Runtime
Functions
t_file.cpp File Reference

Handling of files and calibration data. More...

#include "tracking/t_calibration_opencv.hpp"
#include "util/u_misc.h"
Include dependency graph for t_file.cpp:

Functions

RemapPair calibration_get_undistort_map (t_camera_calibration &calib, cv::InputArray rectify_transform_optional, cv::Mat new_camera_matrix_optional)
 Prepare undistortion/normalization remap structures for a rectilinear or fisheye image. More...
 
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. More...
 
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. More...
 

Detailed Description

Handling of files and calibration data.

Author
Pete Black pblac.nosp@m.k@co.nosp@m.llabo.nosp@m.ra.c.nosp@m.om
Jakob Bornecrantz jakob.nosp@m.@col.nosp@m.labor.nosp@m.a.co.nosp@m.m
Ryan Pavlik ryan..nosp@m.pavl.nosp@m.ik@co.nosp@m.llab.nosp@m.ora.c.nosp@m.om

Function Documentation

◆ calibration_get_undistort_map()

RemapPair calibration_get_undistort_map ( t_camera_calibration calib,
cv::InputArray  rectify_transform_optional = cv::noArray(),
cv::Mat  new_camera_matrix_optional = cv::Mat() 
)

Prepare undistortion/normalization remap structures for a rectilinear or fisheye image.

Parameters
calibA single camera calibration structure.
rectify_transform_optionalA rectification transform to apply, if desired.
new_camera_matrix_optionalUnlike OpenCV, the default/empty matrix here uses the input camera matrix as your output camera matrix.
Todo:
Scale Our intrinsics if the frame size we request

References CameraCalibrationWrapper::distortion_fisheye_mat, CameraCalibrationWrapper::distortion_mat, xrt_size::h, t_camera_calibration::image_size_pixels, CameraCalibrationWrapper::intrinsics_mat, RemapPair::remap_x, RemapPair::remap_y, t_camera_calibration::use_fisheye, and xrt_size::w.

Referenced by StereoRectificationMaps::StereoRectificationMaps().

◆ t_stereo_camera_calibration_load_v1()

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.

References t_stereo_camera_calibration_alloc().

◆ t_stereo_camera_calibration_save_v1()

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.