Monado OpenXR Runtime
|
Simple, untemplated, C, float-only, camera (un)projection functions for various camera models. More...
#include "math/m_vec2.h"
#include "math/m_matrix_2x2.h"
#include "math/m_mathinclude.h"
#include "t_tracking.h"
#include <assert.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_RT8, also including metric_radius. More... | |
struct | t_camera_model_params |
Floating point calibration data for a single calibrated camera. More... | |
Functions | |
static float | kb4_calc_r_theta (const struct t_camera_model_params *dist, const float theta, const float theta2) |
static bool | kb4_project (const struct t_camera_model_params *dist, const float x, const float y, const float z, float *out_x, float *out_y) |
static float | kb4_solve_theta (const struct t_camera_model_params *dist, const float *r_theta, float *d_func_d_theta) |
static bool | kb4_unproject (const struct t_camera_model_params *dist, const float x, const float y, float *out_x, float *out_y, float *out_z) |
static void | kb4_undistort (const struct t_camera_model_params *dist, const float x, const float y, float *out_x, float *out_y) |
static bool | rt8_project (const struct t_camera_model_params *dist, const float x, const float y, const float z, float *out_x, float *out_y) |
static void | rt8_distort (const struct t_camera_model_params *params, const struct xrt_vec2 *undist, struct xrt_vec2 *dist, struct xrt_matrix_2x2 *d_dist_d_undist) |
static void | rt8_undistort (const struct t_camera_model_params *hg_dist, const float u, const float v, float *out_x, float *out_y) |
static bool | rt8_unproject (const struct t_camera_model_params *hg_dist, const float u, const float v, float *out_x, float *out_y, float *out_z) |
static void | interpret_as_rt8 (const struct t_camera_calibration *cc, struct t_camera_model_params *out_params) |
static 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 . More... | |
static 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 . More... | |
static 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 . More... | |
static 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 . More... | |
static 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 . More... | |
static 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 . More... | |
Variables | |
static const float | SQRT_EPSILON = 0.00316 |
Simple, untemplated, C, float-only, camera (un)projection functions for various camera models.
Some notes: These functions should return exactly the same values as basalt-headers, down to floating point bits.
They were mainly written as an expedient way to stop depending on OpenCV-based (un)projection code in Monado's hand tracking code, and to encourage compiler optimizations through inlining.
Current users:
|
inlinestatic |
|
inlinestatic |
computeRpmax()
. Referenced by t_camera_models_undistort().
|
inlinestatic |
Takes a t_camera_calibration through cc
, and returns a t_camera_model_params that shadows cc
's parameters through out_params
.
References t_camera_calibration::distortion_model, t_camera_calibration::intrinsics, T_DISTORTION_FISHEYE_KB4, T_DISTORTION_OPENCV_RADTAN_14, T_DISTORTION_OPENCV_RADTAN_5, T_DISTORTION_OPENCV_RADTAN_8, T_DISTORTION_WMR, and U_ZERO.
|
inlinestatic |
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
.
References t_camera_models_project().
|
inlinestatic |
Takes a 3D point through x
, y
, and z
, projects it into image space, and returns the result through out_x
and out_y
.
References T_DISTORTION_OPENCV_RADTAN_8.
Referenced by t_camera_models_flip_and_project().
|
inlinestatic |
Takes a distorted 2D point through x
and y
and computes the undistorted point into out_x
and out_y
.
References rt8_undistort(), T_DISTORTION_FISHEYE_KB4, and T_DISTORTION_OPENCV_RADTAN_8.
|
inlinestatic |
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
.
References T_DISTORTION_OPENCV_RADTAN_8.
Referenced by t_camera_models_unproject_and_flip().
|
inlinestatic |
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
.
References t_camera_models_unproject().