Monado OpenXR Runtime
Loading...
Searching...
No Matches
t_camera_models.h File Reference

Camera (un)projection C API for various camera models. More...

Include dependency graph for t_camera_models.h:

Go to the source code of this file.

Data Structures

struct  t_camera_calibration_kb4_params_float
 Floating point parameters for T_DISTORTION_FISHEYE_KB4. More...
 
struct  t_camera_calibration_rt8_params_float
 Floating point parameters for T_DISTORTION_OPENCV_RADTAN_8, also including metric_radius. More...
 
struct  t_camera_model_params
 Floating point calibration data for a single calibrated camera. More...
 

Functions

void t_camera_model_params_from_t_camera_calibration (const struct t_camera_calibration *cc, struct t_camera_model_params *out_params)
 Takes a t_camera_calibration through cc, and returns a t_camera_model_params that shadows cc 's parameters through out_params.
 
bool t_camera_models_unproject (const struct t_camera_model_params *dist, const float x, const float y, float *out_x, float *out_y, float *out_z)
 Takes a 2D image-space point through x and y, unprojects it to a normalized 3D direction, and returns the result through out_x, out_y and out_z.
 
bool t_camera_models_unproject_and_flip (const struct t_camera_model_params *dist, const float x, const float y, float *out_x, float *out_y, float *out_z)
 Takes a 2D image-space point through x and y, unprojects it to a normalized 3D direction, flips its Y and Z values (performing a coordinate space transform from +Z forward -Y up to -Z forward +Y up) and returns the result through out_x, out_y and out_z.
 
void t_camera_models_undistort (const struct t_camera_model_params *dist, const float x, const float y, float *out_x, float *out_y)
 Takes a distorted 2D point through x and y and computes the undistorted point into out_x and out_y.
 
bool t_camera_models_project (const struct t_camera_model_params *dist, const float x, const float y, const float z, float *out_x, float *out_y)
 Takes a 3D point through x, y, and z, projects it into image space, and returns the result through out_x and out_y.
 
bool t_camera_models_flip_and_project (const struct t_camera_model_params *dist, const float x, const float y, const float z, float *out_x, float *out_y)
 Takes a 3D point through x, y, and z, flips its Y and Z values (performing a coordinate space transform from -Z forward +Y up to +Z forward -Y up), projects it into image space, and returns the result through out_x and out_y.
 

Detailed Description

Camera (un)projection C API for various camera models.

Author
Moshi Turner moshi.nosp@m.turn.nosp@m.er@pr.nosp@m.oton.nosp@m.mail..nosp@m.com
Beyley Cardellio ep1cm.nosp@m.1n10.nosp@m.n123@.nosp@m.gmai.nosp@m.l.com

Function Documentation

◆ t_camera_model_params_from_t_camera_calibration()

void t_camera_model_params_from_t_camera_calibration ( const struct t_camera_calibration cc,
struct t_camera_model_params out_params 
)

Takes a t_camera_calibration through cc, and returns a t_camera_model_params that shadows cc 's parameters through out_params.

◆ t_camera_models_flip_and_project()

bool t_camera_models_flip_and_project ( const struct t_camera_model_params dist,
const float  x,
const float  y,
const float  z,
float *  out_x,
float *  out_y 
)

Takes a 3D point through x, y, and z, flips its Y and Z values (performing a coordinate space transform from -Z forward +Y up to +Z forward -Y up), projects it into image space, and returns the result through out_x and out_y.

◆ t_camera_models_project()

bool t_camera_models_project ( const struct t_camera_model_params dist,
const float  x,
const float  y,
const float  z,
float *  out_x,
float *  out_y 
)

Takes a 3D point through x, y, and z, projects it into image space, and returns the result through out_x and out_y.

◆ t_camera_models_undistort()

void t_camera_models_undistort ( const struct t_camera_model_params dist,
const float  x,
const float  y,
float *  out_x,
float *  out_y 
)

Takes a distorted 2D point through x and y and computes the undistorted point into out_x and out_y.

◆ t_camera_models_unproject()

bool t_camera_models_unproject ( const struct t_camera_model_params dist,
const float  x,
const float  y,
float *  out_x,
float *  out_y,
float *  out_z 
)

Takes a 2D image-space point through x and y, unprojects it to a normalized 3D direction, and returns the result through out_x, out_y and out_z.

◆ t_camera_models_unproject_and_flip()

bool t_camera_models_unproject_and_flip ( const struct t_camera_model_params dist,
const float  x,
const float  y,
float *  out_x,
float *  out_y,
float *  out_z 
)

Takes a 2D image-space point through x and y, unprojects it to a normalized 3D direction, flips its Y and Z values (performing a coordinate space transform from +Z forward -Y up to -Z forward +Y up) and returns the result through out_x, out_y and out_z.