Monado OpenXR Runtime
rift_s_util.cpp File Reference

Driver code for Oculus Rift S headsets. More...

#include <stdbool.h>
#include <math.h>
#include "tinyceres/tiny_solver.hpp"
#include "tinyceres/tiny_solver_autodiff_function.hpp"
#include "rift_s_util.h"
Include dependency graph for rift_s_util.cpp:

Data Structures

struct  UndistortCostFunctor
 
struct  TargetPoint
 
struct  DistortParamKB4CostFunctor
 

Macros

#define STEPS   21
 

Functions

template<typename T >
bool fisheye62_undistort_func (struct t_camera_calibration *calib, const double *distortion_params, const T point[2], T *out_point)
 
template<typename T >
bool kb4_distort_func (struct t_camera_calibration *calib, const T *distortion_params, const double point[2], T *out_point)
 
struct t_camera_calibration rift_s_get_cam_calib (struct rift_s_camera_calibration_block *camera_calibration, enum rift_s_camera_id cam_id)
 
struct t_stereo_camera_calibrationrift_s_create_stereo_camera_calib_rotated (struct rift_s_camera_calibration_block *camera_calibration)
 Allocate and populate an OpenCV-compatible t_stereo_camera_calibration pointer from the Rift S config. More...
 

Variables

const int N_KB4_DISTORT_PARAMS = 4
 

Detailed Description

Driver code for Oculus Rift S headsets.

Utility functions for generating a stereo camera calibration, and converting the Rift S Fisheye62 distortion parameters into OpenCV-compatible Kannala-Brandt parameters

Author
Jan Schmidt jan@c.nosp@m.entr.nosp@m.icula.nosp@m.r.co.nosp@m.m

Function Documentation

◆ rift_s_create_stereo_camera_calib_rotated()

struct t_stereo_camera_calibration * rift_s_create_stereo_camera_calib_rotated ( struct rift_s_camera_calibration_block camera_calibration)

Allocate and populate an OpenCV-compatible t_stereo_camera_calibration pointer from the Rift S config.

This requires fitting a KB4 fisheye polynomial to the 6 radial + 2 tangential 'Fisheye62' parameters provided by the Rift S.

References T_DISTORTION_FISHEYE_KB4, and t_stereo_camera_calibration::t_stereo_camera_calibration_alloc().