OSVR Framework (Internal Development Docs)  0.6-1962-g59773924
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Modules Pages
osvr::vbtracker::BeaconBasedPoseEstimator Class Reference

Class to track an object that has identified LED beacons on it as seen in a camera, where the absolute location of the LEDs with respect to a common frame of reference is known. Returns the transformation that takes points from the model coordinate system to the camera coordinate system. More...

#include </home/jenkins/root/workspace/OSVR-Core-Docs/plugins/videobasedtracker/BeaconBasedPoseEstimator.h>

Public Member Functions

 BeaconBasedPoseEstimator (CameraParameters const &camParams, size_t requiredInliers=4, size_t permittedOutliers=2, ConfigParams const &params=ConfigParams{})
 Constructor that expects its beacons to be set later. It is told the camera matrix and distortion coefficients, in a format suitable to send to OpenCV. See http://docs.opencv.org/doc/tutorials/calib3d/camera_calibration/camera_calibration.html for details on these formats. More...
 
EIGEN_MAKE_ALIGNED_OPERATOR_NEW
bool 
EstimatePoseFromLeds (LedGroup &leds, OSVR_TimeValue const &tv, OSVR_PoseState &out)
 Produce an estimate of the pose of the model-space origin in camera space, where the origin is at the center of the image as described by the camera matrix. More...
 
std::size_t getNumBeacons () const
 
bool ProjectBeaconsToImage (std::vector< cv::Point2f > &outPose)
 Project the beacons into image space given the most-recent estimation of pose. More...
 
void permitKalmanMode (bool permitKalman)
 
void dumpBeaconLocationsToStream (std::ostream &os) const
 
std::vector< BeaconData > const & getBeaconDebugData () const
 
Eigen::Vector3d getBeaconAutocalibPosition (std::size_t i) const
 
Eigen::Vector3d getBeaconAutocalibVariance (std::size_t i) const
 
State getting methods

They extract state in the OSVR units (meters, not mm, for instance) even when the internal storage may vary.

OSVR_PoseState GetState () const
 
OSVR_PoseState GetPredictedState (double dt) const
 
Eigen::Vector3d GetLinearVelocity () const
 
Eigen::Vector3d GetAngularVelocity () const
 
Data set resets

Replace one of the data sets we're using with a new one.

bool SetBeacons (const Point3Vector &beacons, Vec3Vector const &emissionDirection, std::vector< double > const &variance, BeaconIDPredicate const &autocalibrationFixedPredicate, double beaconAutocalibErrorScale=1)
 
bool SetCameraParameters (CameraParameters const &camParams)
 

Static Public Member Functions

static BeaconIDPredicate getDefaultBeaconFixedPredicate ()
 

Detailed Description

Class to track an object that has identified LED beacons on it as seen in a camera, where the absolute location of the LEDs with respect to a common frame of reference is known. Returns the transformation that takes points from the model coordinate system to the camera coordinate system.

Definition at line 63 of file BeaconBasedPoseEstimator.h.

Constructor & Destructor Documentation

osvr::vbtracker::BeaconBasedPoseEstimator::BeaconBasedPoseEstimator ( CameraParameters const &  camParams,
size_t  requiredInliers = 4,
size_t  permittedOutliers = 2,
ConfigParams const &  params = ConfigParams{} 
)

Constructor that expects its beacons to be set later. It is told the camera matrix and distortion coefficients, in a format suitable to send to OpenCV. See http://docs.opencv.org/doc/tutorials/calib3d/camera_calibration/camera_calibration.html for details on these formats.

Parameters
camParamsIntrinsic camera parameters (camera matrix and distortion)
beacons3D beacon locations
requiredInliersHow many "good" points must be available
permittedOutliersHow many additional "bad" points we can have

Definition at line 55 of file BeaconBasedPoseEstimator.cpp.

Member Function Documentation

bool osvr::vbtracker::BeaconBasedPoseEstimator::EstimatePoseFromLeds ( LedGroup &  leds,
OSVR_TimeValue const &  tv,
OSVR_PoseState out 
)

Produce an estimate of the pose of the model-space origin in camera space, where the origin is at the center of the image as described by the camera matrix.

This pose will be expressed in meters even though the beacon locations and camera focal depth are in millimeters.

Returns
Returns true on success, false on failure to make a pose.

Definition at line 155 of file BeaconBasedPoseEstimator.cpp.

bool osvr::vbtracker::BeaconBasedPoseEstimator::ProjectBeaconsToImage ( std::vector< cv::Point2f > &  outPose)

Project the beacons into image space given the most-recent estimation of pose.

Returns
true on success, false on failure.

Definition at line 407 of file BeaconBasedPoseEstimator.cpp.

void osvr::vbtracker::BeaconBasedPoseEstimator::permitKalmanMode ( bool  permitKalman)

Some uses of this may require explicitly disabling kalman mode until a condition is met. This permits that.

Definition at line 424 of file BeaconBasedPoseEstimator.cpp.

bool osvr::vbtracker::BeaconBasedPoseEstimator::SetBeacons ( const Point3Vector &  beacons,
Vec3Vector const &  emissionDirection,
std::vector< double > const &  variance,
BeaconIDPredicate const &  autocalibrationFixedPredicate,
double  beaconAutocalibErrorScale = 1 
)

A single entry in the variance array implies use that for all beacons.

Definition at line 64 of file BeaconBasedPoseEstimator.cpp.


The documentation for this class was generated from the following files: