Monado OpenXR Runtime
Loading...
Searching...
No Matches
ransac.cpp File Reference

RANSAC PnP solver. More...

#include "math/m_api.h"
#include "math/m_eigen_interop.hpp"
#include "tracking/t_camera_models.hpp"
#include "tracking/t_constellation.h"
#include "constellation/lambdatwist/lambdatwist_p3p.h"
#include "constellation/pose_metrics.h"
#include "constellation/correspondence_search.h"
#include "ransac.hpp"
#include <algorithm>
#include <cstdlib>
#include <iterator>
#include <random>
#include <stdexcept>
#include <numeric>
#include <cmath>
Include dependency graph for ransac.cpp:

Functions

bool xrt::tracking::constellation::optimizer::ransacPose (bool deterministic, const t_camera_model_params &dist, const std::vector< t_blob * > &data_points_2d_f32, const std::vector< Eigen::Vector3f > &data_points_3d_f32, const std::vector< Eigen::Vector3f > &data_points_3d_normals_f32, std::vector< size_t > &inlier_indices, xrt_pose &out_pose)
 

Detailed Description

RANSAC PnP solver.

Author
Beyley Cardellio ep1cm.nosp@m.1n10.nosp@m.n123@.nosp@m.gmai.nosp@m.l.com

Function Documentation

◆ ransacPose()

bool xrt::tracking::constellation::optimizer::ransacPose ( bool  deterministic,
const t_camera_model_params &  dist,
const std::vector< t_blob * > &  data_points_2d_f32,
const std::vector< Eigen::Vector3f > &  data_points_3d_f32,
const std::vector< Eigen::Vector3f > &  data_points_3d_normals_f32,
std::vector< size_t > &  inlier_indices,
xrt_pose &  out_pose 
)

LEDs can be closer than the device's origin (gated by CLOSEST_ACCEPTABLE_POSE_M), but we also want to punish LEDs that are really close, since that's almost certainly invalid too.

We also want to punish LEDs that are behind the camera, this does both at once.

References ANCHOR_LED_MAX_DISTANCE_M_SQ, CLOSEST_ACCEPTABLE_POSE_M, FARTHEST_ACCEPTABLE_POSE_M, xrt::auxiliary::math::map_quat(), xrt::auxiliary::math::map_vec3(), and xrt::tracking::constellation::optimizer::ransacPose().

Referenced by xrt::tracking::constellation::optimizer::optimizePose(), and xrt::tracking::constellation::optimizer::ransacPose().