Public Member Functions | Private Member Functions | Private Attributes | List of all members
aruco::MarkerPoseTracker Class Reference

#include <posetracker.h>

Public Member Functions

bool estimatePose (Marker &m, const CameraParameters &cam_params, float markerSize, float minErrorRatio=4)
 estimatePose More...
 
cv::Mat getRTMatrix () const
 
const cv::Mat getRvec () const
 
const cv::Mat getTvec () const
 

Private Member Functions

double solve_pnp (const std::vector< cv::Point3f > &p3d, const std::vector< cv::Point2f > &p2d, const cv::Mat &cam_matrix, const cv::Mat &dist, cv::Mat &r_io, cv::Mat &t_io)
 

Private Attributes

cv::Mat _rvec
 
cv::Mat _tvec
 

Detailed Description

Tracks the position of a marker. Instead of trying to calculate the position from scratch everytime, it uses past observations to estimate the pose. It should solve the problem with ambiguities that arises in some circumstances

To solve ambiguity we follow the following idea. We are using the IPPE method, which returns the two possible solutions s0,s1. Error solution has a reprojection error e(s_i) and it is assumed that e(s0)<e(s1). If the reprojection errors are similar, then, it is difficult from only one image to know the correct location. So, if the error ratio er=e(s_1)/e(s_0) ~ 1, there is a possible ambiguity problem. Please notice that er is in range [1,inf)

To solve the problem, we should do a tracking process, so that when the ambiguity occur, you can select the solution nearest to the previos position.

So, the only problem now becomes the initialization. You have two options. First, you wait for a position in which ambiguity does not happen. When a robuts position is seen, you start tracking. Scond, you risk and start tracking and if later you discover the error, you correct.

This idea is implemented in the tracker.

Call estimatePose indicated as last parameter the error ratio you want for the initialization. If the parameter is set er=1, then you start right away. Be warned then that you might suffer a big shift later if there was an erroneous starting location

If you do not want to risk, I recommen using more conservative approach, use a value of er=4.

Definition at line 57 of file posetracker.h.

Member Function Documentation

bool aruco::MarkerPoseTracker::estimatePose ( Marker m,
const CameraParameters cam_params,
float  markerSize,
float  minErrorRatio = 4 
)

estimatePose

estimate the pose of the marker.

Parameters
mmarker info
cam_paramscamera parameters
markerSize
minErrorRatiosee explanation above. If you want to be conservative, use minErrorRatio=4.
Returns
true if the pose is estimated and false otherwise. If not estimated, the parameters m.Rvec and m.Tvec and not set.

Definition at line 104 of file posetracker.cpp.

cv::Mat aruco::MarkerPoseTracker::getRTMatrix ( ) const

Definition at line 215 of file posetracker.cpp.

const cv::Mat aruco::MarkerPoseTracker::getRvec ( ) const
inline

Definition at line 72 of file posetracker.h.

const cv::Mat aruco::MarkerPoseTracker::getTvec ( ) const
inline

Definition at line 74 of file posetracker.h.

double aruco::MarkerPoseTracker::solve_pnp ( const std::vector< cv::Point3f > &  p3d,
const std::vector< cv::Point2f > &  p2d,
const cv::Mat &  cam_matrix,
const cv::Mat &  dist,
cv::Mat &  r_io,
cv::Mat &  t_io 
)
private

Member Data Documentation

cv::Mat aruco::MarkerPoseTracker::_rvec
private

Definition at line 77 of file posetracker.h.

cv::Mat aruco::MarkerPoseTracker::_tvec
private

Definition at line 77 of file posetracker.h.


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


tuw_aruco
Author(s): Lukas Pfeifhofer
autogenerated on Mon Jun 10 2019 15:41:03