OSVR-Core
Public Types | Public Member Functions | Static Public Member Functions | List of all members
osvr::vbtracker::VideoBasedTracker Class Reference

Public Types

typedef std::function< void(OSVR_ChannelCount, OSVR_Pose3 const &)> PoseHandler
 

Public Member Functions

 VideoBasedTracker (ConfigParams const &params=ConfigParams{})
 
bool processImage (cv::Mat frame, cv::Mat grayImage, OSVR_TimeValue const &tv, PoseHandler handler)
 The main method that processes an image into tracked poses. More...
 
BeaconBasedPoseEstimator const & getFirstEstimator () const
 For debug purposes.
 
BeaconBasedPoseEstimatorgetFirstEstimator ()
 For debug purposes.
 
Sensor addition methods

Adds a sensor, given an LedIdentifier and parameters to create a pose estimator.

Parameters
identifierTakes unique ownership of the passed LedIdentifier object
camParamsAn object with the camera matrix and distortion parameters.
locationsA list of the 3d locations (in mm) of each marker
emissionDirectionNormalized vectors for each beacon in body space giving their emission direction.
varianceA single default base measurement variance used as a starting point for all beacons.
autocalibrationFixedPredicateA function that, when given a 1-based ID of a beacon, returns "true" if the autocalibration routines should consider that beacon "fixed" and not subject to autocalibration.
requiredInliersHow many "good" points must be available
permittedOutliersHow many additional "bad" points we can have
void addSensor (LedIdentifierPtr &&identifier, CameraParameters const &camParams, Point3Vector const &locations, Vec3Vector const &emissionDirection, double variance, BeaconIDPredicate const &autocalibrationFixedPredicate=getDefaultBeaconFixedPredicate(), size_t requiredInliers=4, size_t permittedOutliers=2)
 
void addSensor (LedIdentifierPtr &&identifier, CameraParameters const &camParams, Point3Vector const &locations, Vec3Vector const &emissionDirection, BeaconIDPredicate const &autocalibrationFixedPredicate, size_t requiredInliers=4, size_t permittedOutliers=2)
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.For those who want the default variance but want to provide an autocalibration fixed predicate or more. More...
 
void addSensor (LedIdentifierPtr &&identifier, CameraParameters const &camParams, Point3Vector const &locations, Vec3Vector const &emissionDirection, std::vector< double > const &variance=std::vector< double >{}, BeaconIDPredicate const &autocalibrationFixedPredicate=getDefaultBeaconFixedPredicate(), size_t requiredInliers=4, size_t permittedOutliers=2, double beaconAutocalibErrorScale=1)
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. Takes a vector of default measurement variances, one per beacon. More...
 

Static Public Member Functions

static BeaconIDPredicate getDefaultBeaconFixedPredicate ()
 

Member Function Documentation

§ addSensor() [1/2]

void osvr::vbtracker::VideoBasedTracker::addSensor ( LedIdentifierPtr &&  identifier,
CameraParameters const &  camParams,
Point3Vector const &  locations,
Vec3Vector const &  emissionDirection,
BeaconIDPredicate const &  autocalibrationFixedPredicate,
size_t  requiredInliers = 4,
size_t  permittedOutliers = 2 
)
inline

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.For those who want the default variance but want to provide an autocalibration fixed predicate or more.

§ addSensor() [2/2]

void osvr::vbtracker::VideoBasedTracker::addSensor ( LedIdentifierPtr &&  identifier,
CameraParameters const &  camParams,
Point3Vector const &  locations,
Vec3Vector const &  emissionDirection,
std::vector< double > const &  variance = std::vector<double>{},
BeaconIDPredicate const &  autocalibrationFixedPredicate = getDefaultBeaconFixedPredicate(),
size_t  requiredInliers = 4,
size_t  permittedOutliers = 2,
double  beaconAutocalibErrorScale = 1 
)

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. Takes a vector of default measurement variances, one per beacon.

By default (if empty) a default overall base measurement variance is used. If only a single entry is in the vector, it is used for every beacon.

(This is actually the one that does the work.)

§ processImage()

bool osvr::vbtracker::VideoBasedTracker::processImage ( cv::Mat  frame,
cv::Mat  grayImage,
OSVR_TimeValue const &  tv,
PoseHandler  handler 
)

The main method that processes an image into tracked poses.

Returns
true if user hit q to quit in a debug window, if such a thing exists.

Perform the undistortion of keypoints


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