OSVR-Core
|
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. More...
#include <BeaconBasedPoseEstimator.h>
Public Member Functions | |
BeaconBasedPoseEstimator (CameraParameters const &camParams, size_t requiredInliers=4, size_t permittedOutliers=2, ConfigParams const ¶ms=ConfigParams{}) | |
Constructor that expects its beacons to be set later. 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) |
Some uses of this may require explicitly disabling kalman mode until a condition is met. More... | |
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 () |
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.
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.
camParams | Intrinsic camera parameters (camera matrix and distortion) |
beacons | 3D beacon locations |
requiredInliers | How many "good" points must be available |
permittedOutliers | How many additional "bad" points we can have |
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.
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.
bool osvr::vbtracker::BeaconBasedPoseEstimator::ProjectBeaconsToImage | ( | std::vector< cv::Point2f > & | outPose | ) |
Project the beacons into image space given the most-recent estimation of pose.
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.