Class FractalPoseTracker

Class Documentation

class FractalPoseTracker

Public Functions

FractalPoseTracker()
void setParams(const CameraParameters &cam_params, const FractalMarkerSet &msconf, const float markerSize = -1)

setParams

init fractlPoseTracker parameters

Parameters:
bool fractalInnerPose(const cv::Ptr<MarkerDetector> markerDetector, const std::vector<aruco::Marker> &markers, bool refinement = true)

fractalInnerPose

estimate the pose of the fractal marker.

Parameters:
  • markerDetector

  • detected – markers

  • refinement, use – or not pose refinement. True by default.

Returns:

true if the pose is estimated and false otherwise. If not estimated, the parameters m.Rvec and m.Tvec and not set.

bool ROI(const std::vector<cv::Mat> imagePyramid, cv::Mat &img, std::vector<cv::Point2f> &innerPoints2d, cv::Point2f &offset, float &ratio)

ROI.

extraction of the region of the image where the marker is estimated to be based on the previous pose

Parameters:
  • imagePyramid – set images

  • img – original image. The image is scaled according to the selected pyramid image.

  • innerPoints2d – collection fractal inner points. The points are scaled according to the selected pyramid image.

  • offset. – Position of the upper inner corner of the marker. The offset is scaled according to the selected pyramid image.

  • ratio – selected scaling factor

cv::Mat fractal_solve_ransac(int ninners, std::vector<std::pair<uint, std::vector<uint>>> inner_kpnt, std::vector<cv::KeyPoint> kpnts, uint32_t maxIter = 500, float _minInliers = 0.2f, float _thresInliers = 0.7f)

fractal_solve_ransac

estimate the pose of the fractal marker. Method case 2, paper.

Parameters:
  • ninners – (number of total inners points used)

  • inner_kpnt – matches (inner points - detected keypoints)

  • kpnts – keypoints

  • maxIter – maximum number of iterations

  • _minInliers – beta in paper

  • _thresInliers – alpha in paper

Returns:

Mat best model homography.

void drawKeyPoints(const cv::Mat image, std::vector<cv::KeyPoint> kpoints, bool text = false, bool transf = false)

image

Draw keypoints

Parameters:
  • kpoints

  • text

  • transf. – Is it necessary to transform keypoints? (-MarkerSize/2 .. MarkerSize/2) to (0 .. ImageSize)

bool fractalRefinement(const cv::Ptr<MarkerDetector> markerDetector, int markerWarpPix = 10)

fractalRefinement

Refinement of the internal points of the marker and pose estimation with these.

Parameters:
  • markerDetector

  • markerWarpPix. – Optimal markerwarpPix used to select the image of the pyramid. Default value 10.

Returns:

true if the pose is estimated and false otherwise. If not estimated, the parameters m.Rvec and m.Tvec and not set.

inline const cv::Mat getRvec() const
inline const cv::Mat getTvec() const
inline const std::vector<cv::Point3f> getInner3d()
inline bool isPoseValid() const
inline FractalMarkerSet getFractal()