Program Listing for File pnp-pose-estimator.h

Return to documentation for file (aslam_cv2/aslam_cv_geometric_vision/include/aslam/geometric-vision/pnp-pose-estimator.h)

#ifndef GEOMETRIC_VISION_PNP_POSE_ESTIMATOR_H_
#define GEOMETRIC_VISION_PNP_POSE_ESTIMATOR_H_

#include <memory>
#include <vector>

#include <Eigen/Core>
#include <glog/logging.h>

#include <aslam/cameras/camera.h>
#include <aslam/cameras/ncamera.h>
#include <aslam/common/pose-types.h>

namespace aslam {
namespace geometric_vision {

class PnpPoseEstimator {
 public:
  explicit PnpPoseEstimator(bool run_nonlinear_refinement)
      : random_seed_(true),
        run_nonlinear_refinement_(run_nonlinear_refinement) {}
  PnpPoseEstimator(bool run_nonlinear_refinement, bool random_seed)
      : random_seed_(random_seed),
        run_nonlinear_refinement_(run_nonlinear_refinement) {}

  bool absolutePoseRansacPinholeCam(
      const Eigen::Matrix2Xd& measurements,
      const Eigen::Matrix3Xd& G_landmark_positions, double pixel_sigma,
      int max_ransac_iters, aslam::Camera::ConstPtr camera_ptr,
      aslam::Transformation* T_G_C, std::vector<int>* inliers, int* num_iters);

  bool absoluteMultiPoseRansacPinholeCam(
      const Eigen::Matrix2Xd& measurements,
      const std::vector<int>& measurement_camera_indices,
      const Eigen::Matrix3Xd& G_landmark_positions, double pixel_sigma,
      int max_ransac_iters, aslam::NCamera::ConstPtr ncamera_ptr,
      aslam::Transformation* T_G_I, std::vector<int>* inliers, int* num_iters);
  bool absoluteMultiPoseRansacPinholeCam(
      const Eigen::Matrix2Xd& measurements,
      const std::vector<int>& measurement_camera_indices,
      const Eigen::Matrix3Xd& G_landmark_positions, double pixel_sigma,
      int max_ransac_iters, aslam::NCamera::ConstPtr ncamera_ptr,
      aslam::Transformation* T_G_I, std::vector<int>* inliers,
      std::vector<double>* inlier_distances_to_model, int* num_iters);

  bool absolutePoseRansac(const Eigen::Matrix2Xd& measurements,
                          const Eigen::Matrix3Xd& G_landmark_positions,
                          double pixel_sigma, int max_ransac_iters,
                          aslam::Camera::ConstPtr camera_ptr,
                          aslam::Transformation* T_G_C,
                          std::vector<int>* inliers, int* num_iters);

  bool absoluteMultiPoseRansac(
      const Eigen::Matrix2Xd& measurements,
      const std::vector<int>& measurement_camera_indices,
      const Eigen::Matrix3Xd& G_landmark_positions, double ransac_threshold,
      int max_ransac_iters, aslam::NCamera::ConstPtr ncamera_ptr,
      aslam::Transformation* T_G_I, std::vector<int>* inliers, int* num_iters);
  bool absoluteMultiPoseRansac(
      const Eigen::Matrix2Xd& measurements,
      const std::vector<int>& measurement_camera_indices,
      const Eigen::Matrix3Xd& G_landmark_positions, double ransac_threshold,
      int max_ransac_iters, aslam::NCamera::ConstPtr ncamera_ptr,
      aslam::Transformation* T_G_I, std::vector<int>* inliers,
      std::vector<double>* inlier_distances_to_model, int* num_iters);


 private:
  const bool random_seed_;

  const bool run_nonlinear_refinement_;
};

}  // namespace geometric_vision
}  // namespace aslam

#endif  // GEOMETRIC_VISION_PNP_POSE_ESTIMATOR_H_