51 #ifndef vpHomography_hh
52 #define vpHomography_hh
57 #include <visp/vpCameraParameters.h>
58 #include <visp/vpImagePoint.h>
59 #include <visp/vpHomogeneousMatrix.h>
60 #include <visp/vpPlane.h>
61 #ifdef VISP_BUILD_DEPRECATED_FUNCTIONS
62 # include <visp/vpList.h>
185 static const double sing_threshold;
186 static const double threshold_rotation;
187 static const double threshold_displacement;
206 void insert(
const vpPlane &bP) ;
208 static void initRansac(
unsigned int n,
209 double *xb,
double *yb,
210 double *xa,
double *ya,
257 inline unsigned int getRows()
const {
return 3;}
259 inline unsigned int getCols()
const {
return 3; }
267 void load(std::ifstream &f) ;
270 inline double *
operator[](
unsigned int i) {
return &data[i*3]; }
272 inline double *
operator[](
unsigned int i)
const {
return &data[i*3];}
288 void save(std::ofstream &f)
const ;
292 friend VISP_EXPORT std::ostream &operator << (std::ostream &s,
const vpHomography &H);
294 static void DLT(
const std::vector<double> &xb,
const std::vector<double> &yb,
295 const std::vector<double> &xa,
const std::vector<double> &ya ,
297 bool normalization=
true);
299 static void HLM(
const std::vector<double> &xb,
const std::vector<double> &yb,
300 const std::vector<double> &xa,
const std::vector<double> &ya,
304 static bool ransac(
const std::vector<double> &xb,
const std::vector<double> &yb,
305 const std::vector<double> &xa,
const std::vector<double> &ya,
307 std::vector<bool> &inliers,
309 unsigned int nbInliersConsensus,
311 bool normalization=
true);
316 static void robust(
const std::vector<double> &xb,
const std::vector<double> &yb,
317 const std::vector<double> &xa,
const std::vector<double> &ya,
319 std::vector<bool> &inlier,
321 double weights_threshold=0.4,
322 unsigned int niter=4,
323 bool normalization=
true);
325 #ifndef DOXYGEN_SHOULD_SKIP_THIS
331 static void computeDisplacement(
const vpHomography &aHb,
337 static void computeDisplacement (
const vpHomography &aHb,
342 static void computeDisplacement(
const vpMatrix &H,
345 std::list<vpRotationMatrix> & vR,
346 std::list<vpTranslationVector> & vT,
347 std::list<vpColVector> & vN) ;
348 static double computeDisplacement(
unsigned int nbpoint,
356 static double computeDisplacement(
unsigned int nbpoint,
366 static double computeRotation(
unsigned int nbpoint,
372 static bool degenerateConfiguration(
vpColVector &x,
unsigned int *ind) ;
373 static bool degenerateConfiguration(
vpColVector &x,
unsigned int *ind,
double threshold_area);
374 static bool degenerateConfiguration(
const std::vector<double> &xb,
const std::vector<double> &yb,
375 const std::vector<double> &xa,
const std::vector<double> &ya);
376 static void HartleyNormalization(
unsigned int n,
377 const double *x,
const double *y,
378 double *xn,
double *yn,
379 double &xg,
double &yg,
381 static void HartleyNormalization(
const std::vector<double> &x,
const std::vector<double> &y,
382 std::vector<double> &xn, std::vector<double> &yn,
383 double &xg,
double &yg,
double &coef);
386 double xg1,
double yg1,
double coef1,
387 double xg2,
double yg2,
double coef2 ) ;
389 #endif // DOXYGEN_SHOULD_SKIP_THIS
391 #ifdef VISP_BUILD_DEPRECATED_FUNCTIONS
395 vp_deprecated
static void computeDisplacement(
const vpMatrix H,
402 static void DLT(
unsigned int n,
403 double *xb,
double *yb ,
404 double *xa,
double *ya,
406 vp_deprecated
static void HartleyDLT(
unsigned int n,
407 double *xb,
double *yb ,
408 double *xa,
double *ya,
411 static void HLM(
unsigned int n,
412 double *xb,
double *yb,
413 double *xa,
double *ya ,
418 vp_deprecated
void print() ;
420 vp_deprecated
static bool ransac(
unsigned int n,
421 double *xb,
double *yb,
422 double *xa,
double *ya ,
424 int consensus = 1000,
425 double threshold = 1e-6) ;
427 vp_deprecated
static bool ransac(
unsigned int n,
428 double *xb,
double *yb,
429 double *xa,
double *ya ,
432 double residual = 0.1,
433 int consensus = 1000,
434 double threshold = 1e-6,
435 double areaThreshold = 0.0);
437 #endif // VISP_BUILD_DEPRECATED_FUNCTIONS
Definition of the vpMatrix class.
The class provides a data structure for the homogeneous matrices as well as a set of operations on th...
Provide simple list management.
Class that defines what is a point.
The vpRotationMatrix considers the particular case of a rotation matrix.
This class aims to compute the homography wrt.two images.
unsigned int getRows() const
Return the number of rows of the homography matrix.
Generic class defining intrinsic camera parameters.
unsigned int getCols() const
Return the number of columns of the homography matrix.
Class that provides a data structure for the column vectors as well as a set of operations on these v...
The pose is a complete representation of every rigid motion in the euclidian space.
double * operator[](unsigned int i)
Write elements Hij (usage : H[i][j] = x )
Class that defines a 2D point in an image. This class is useful for image processing and stores only ...
This class defines the container for a plane geometrical structure.
Class that consider the case of a translation vector.
double * operator[](unsigned int i) const
Read elements Hij (usage : x = H[i][j] )
Class that consider the case of the parameterization for the rotation.