41#ifndef VP_HOMOGRAPHY_H
42#define VP_HOMOGRAPHY_H
47#include <visp3/core/vpCameraParameters.h>
48#include <visp3/core/vpHomogeneousMatrix.h>
49#include <visp3/core/vpImagePoint.h>
50#include <visp3/core/vpMatrix.h>
51#include <visp3/core/vpPlane.h>
52#include <visp3/core/vpPoint.h>
320 void load(std::ifstream &f);
415 VP_NORETURN
void resize(
unsigned int nrows,
unsigned int ncols,
bool flagNullify =
true)
430 void save(std::ofstream &f)
const;
500 static void DLT(
const std::vector<double> &xb,
const std::vector<double> &yb,
const std::vector<double> &xa,
501 const std::vector<double> &ya,
vpHomography &aHb,
bool normalization =
true);
530 static void HLM(
const std::vector<double> &xb,
const std::vector<double> &yb,
const std::vector<double> &xa,
531 const std::vector<double> &ya,
bool isplanar,
vpHomography &aHb);
563 static bool ransac(
const std::vector<double> &xb,
const std::vector<double> &yb,
const std::vector<double> &xa,
564 const std::vector<double> &ya,
vpHomography &aHb, std::vector<bool> &inliers,
double &residual,
565 unsigned int nbInliersConsensus,
double threshold,
bool normalization =
true);
631 static void robust(
const std::vector<double> &xb,
const std::vector<double> &yb,
const std::vector<double> &xa,
632 const std::vector<double> &ya,
vpHomography &aHb, std::vector<bool> &inliers,
double &residual,
633 double weights_threshold = 0.4,
unsigned int niter = 4,
bool normalization =
true);
635#ifndef DOXYGEN_SHOULD_SKIP_THIS
644 static void computeDisplacement(
const vpHomography &H,
double x,
double y, std::list<vpRotationMatrix> &vR,
645 std::list<vpTranslationVector> &vT, std::list<vpColVector> &vN);
655 static bool degenerateConfiguration(
const vpColVector &x,
unsigned int *ind);
656 static bool degenerateConfiguration(
const vpColVector &x,
unsigned int *ind,
double threshold_area);
657 static bool degenerateConfiguration(
const std::vector<double> &xb,
const std::vector<double> &yb,
658 const std::vector<double> &xa,
const std::vector<double> &ya);
659 static void hartleyNormalization(
unsigned int n,
const double *x,
const double *y,
double *xn,
double *yn,
double &xg,
660 double &yg,
double &coef);
661 static void hartleyNormalization(
const std::vector<double> &x,
const std::vector<double> &y, std::vector<double> &xn,
662 std::vector<double> &yn,
double &xg,
double &yg,
double &coef);
664 double xg2,
double yg2,
double coef2);
669 static const double m_sing_threshold;
670 static const double m_threshold_rotation;
671 static const double m_threshold_displacement;
710 static void initRansac(
unsigned int n,
double *xb,
double *yb,
double *xa,
double *ya,
vpColVector &x);
vpArray2D< Type > & operator=(Type x)
Set all the elements of the array to x.
void insert(const vpArray2D< Type > &A, unsigned int r, unsigned int c)
static bool load(const std::string &filename, vpArray2D< Type > &A, bool binary=false, char *header=nullptr)
static bool save(const std::string &filename, const vpArray2D< Type > &A, bool binary=false, const char *header="")
Generic class defining intrinsic camera parameters.
Implementation of column vector and the associated operations.
error that can be emitted by ViSP classes.
Implementation of an homogeneous matrix and operations on such kind of matrices.
Implementation of an homography and operations on homographies.
vpHomography collineation2homography(const vpCameraParameters &cam) const
vpImagePoint projection(const vpImagePoint &ipb)
vpHomography inverse(double sv_threshold=1e-16, unsigned int *rank=nullptr) const
void computeDisplacement(vpRotationMatrix &aRb, vpTranslationVector &atb, vpColVector &n)
vpHomography & operator/=(double v)
VP_NORETURN void resize(unsigned int nrows, unsigned int ncols, bool flagNullify=true)
vpHomography operator*(const vpHomography &H) const
vpHomography operator/(const double &v) const
vpHomography homography2collineation(const vpCameraParameters &cam) const
vpHomography & buildFrom(const vpRotationMatrix &aRb, const vpTranslationVector &atb, const vpPlane &bP)
Construction from translation and rotation and a plane.
Class that defines a 2D point in an image. This class is useful for image processing and stores only ...
Implementation of a matrix and operations on matrices.
This class defines the container for a plane geometrical structure.
Class that defines a 3D point in the object frame and allows forward projection of a 3D point in the ...
Implementation of a pose vector and operations on poses.
Implementation of a rotation matrix and operations on such kind of matrices.
Implementation of a rotation vector as axis-angle minimal representation.
Class that consider the case of a translation vector.