Class MarkerPoseTracker
Defined in File posetracker.h
Class Documentation
-
class MarkerPoseTracker
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.
Public Functions
-
bool estimatePose(Marker &m, const CameraParameters &cam_params, float markerSize, float minErrorRatio = 10)
estimatePose
estimate the pose of the marker.
- Parameters:
m – marker info
cam_params – camera parameters
markerSize –
minErrorRatio – see explanation above. If you want to be conservative, use minErrorRatio=4. tau_e in paper
- Returns:
true if the pose is estimated and false otherwise. If not estimated, the parameters m.Rvec and m.Tvec and not set.
-
cv::Mat getRTMatrix() const
-
inline const cv::Mat getRvec() const
-
inline const cv::Mat getTvec() const
-
bool estimatePose(Marker &m, const CameraParameters &cam_params, float markerSize, float minErrorRatio = 10)