Visual Servoing Platform
version 3.2.0 under development (2019-01-22)
|
#include <visp3/core/vpHomogeneousMatrix.h>
Public Member Functions | |
vpHomogeneousMatrix () | |
vpHomogeneousMatrix (const vpHomogeneousMatrix &M) | |
vpHomogeneousMatrix (const vpTranslationVector &t, const vpRotationMatrix &R) | |
vpHomogeneousMatrix (const vpTranslationVector &t, const vpThetaUVector &tu) | |
vpHomogeneousMatrix (const vpTranslationVector &t, const vpQuaternionVector &q) | |
vpHomogeneousMatrix (const vpPoseVector &p) | |
vpHomogeneousMatrix (const std::vector< float > &v) | |
vpHomogeneousMatrix (const std::vector< double > &v) | |
vpHomogeneousMatrix (const double tx, const double ty, const double tz, const double tux, const double tuy, const double tuz) | |
virtual | ~vpHomogeneousMatrix () |
void | buildFrom (const vpTranslationVector &t, const vpRotationMatrix &R) |
void | buildFrom (const vpTranslationVector &t, const vpThetaUVector &tu) |
void | buildFrom (const vpTranslationVector &t, const vpQuaternionVector &q) |
void | buildFrom (const vpPoseVector &p) |
void | buildFrom (const std::vector< float > &v) |
void | buildFrom (const std::vector< double > &v) |
void | buildFrom (const double tx, const double ty, const double tz, const double tux, const double tuy, const double tuz) |
void | convert (std::vector< float > &M) |
void | convert (std::vector< double > &M) |
void | eye () |
vpColVector | getCol (const unsigned int j) const |
vpRotationMatrix | getRotationMatrix () const |
vpThetaUVector | getThetaUVector () const |
vpTranslationVector | getTranslationVector () const |
vpHomogeneousMatrix | inverse () const |
void | inverse (vpHomogeneousMatrix &Mi) const |
bool | isAnHomogeneousMatrix () const |
void | insert (const vpRotationMatrix &R) |
void | insert (const vpThetaUVector &tu) |
void | insert (const vpTranslationVector &t) |
void | insert (const vpQuaternionVector &t) |
void | extract (vpRotationMatrix &R) const |
void | extract (vpThetaUVector &tu) const |
void | extract (vpTranslationVector &t) const |
void | extract (vpQuaternionVector &q) const |
void | load (std::ifstream &f) |
void | save (std::ofstream &f) const |
vpHomogeneousMatrix & | operator= (const vpHomogeneousMatrix &M) |
vpHomogeneousMatrix | operator* (const vpHomogeneousMatrix &M) const |
vpHomogeneousMatrix & | operator*= (const vpHomogeneousMatrix &M) |
vpColVector | operator* (const vpColVector &v) const |
vpTranslationVector | operator* (const vpTranslationVector &t) const |
vpPoint | operator* (const vpPoint &bP) const |
void | print () const |
void | resize (const unsigned int nrows, const unsigned int ncols, const bool flagNullify=true) |
Deprecated functions | |
vp_deprecated void | init () |
vp_deprecated void | setIdentity () |
Inherited functionalities from vpArray2D | |
unsigned int | getCols () const |
double | getMaxValue () const |
double | getMinValue () const |
unsigned int | getRows () const |
unsigned int | size () const |
void | resize (const unsigned int nrows, const unsigned int ncols, const bool flagNullify=true, const bool recopy_=true) |
double * | operator[] (unsigned int i) |
double * | operator[] (unsigned int i) const |
vpArray2D< double > | hadamard (const vpArray2D< double > &m) const |
Static Public Member Functions | |
static vpHomogeneousMatrix | mean (const std::vector< vpHomogeneousMatrix > &vec_M) |
Inherited I/O from vpArray2D with Static Public Member Functions | |
static bool | load (const std::string &filename, vpArray2D< double > &A, const bool binary=false, char *header=NULL) |
static bool | loadYAML (const std::string &filename, vpArray2D< double > &A, char *header=NULL) |
static bool | save (const std::string &filename, const vpArray2D< double > &A, const bool binary=false, const char *header="") |
static bool | saveYAML (const std::string &filename, const vpArray2D< double > &A, const char *header="") |
Public Attributes | |
double * | data |
Protected Attributes | |
unsigned int | rowNum |
unsigned int | colNum |
double ** | rowPtrs |
unsigned int | dsize |
Related Functions | |
(Note that these are not member functions.) | |
enum | vpGEMMmethod |
Implementation of an homogeneous matrix and operations on such kind of matrices.
The class provides a data structure for the homogeneous matrices as well as a set of operations on these matrices.
The vpHomogeneousMatrix class is derived from vpArray2D<double>.
An homogeneous matrix is 4x4 matrix defines as
that defines the position of frame b in frame a
is a rotation matrix and is a translation vector.
Definition at line 92 of file vpHomogeneousMatrix.h.
vpHomogeneousMatrix::vpHomogeneousMatrix | ( | ) |
Default constructor that initialize an homogeneous matrix as identity.
Definition at line 66 of file vpHomogeneousMatrix.cpp.
References eye().
vpHomogeneousMatrix::vpHomogeneousMatrix | ( | const vpHomogeneousMatrix & | M | ) |
Copy constructor that initialize an homogeneous matrix from another homogeneous matrix.
Definition at line 72 of file vpHomogeneousMatrix.cpp.
vpHomogeneousMatrix::vpHomogeneousMatrix | ( | const vpTranslationVector & | t, |
const vpRotationMatrix & | R | ||
) |
Construct an homogeneous matrix from a translation vector and a rotation matrix.
Definition at line 89 of file vpHomogeneousMatrix.cpp.
References insert().
vpHomogeneousMatrix::vpHomogeneousMatrix | ( | const vpTranslationVector & | t, |
const vpThetaUVector & | tu | ||
) |
Construct an homogeneous matrix from a translation vector and rotation vector.
Definition at line 78 of file vpHomogeneousMatrix.cpp.
References buildFrom().
vpHomogeneousMatrix::vpHomogeneousMatrix | ( | const vpTranslationVector & | t, |
const vpQuaternionVector & | q | ||
) |
Construct an homogeneous matrix from a translation vector and quaternion rotation vector.
Definition at line 56 of file vpHomogeneousMatrix.cpp.
References buildFrom().
|
explicit |
Construct an homogeneous matrix from a pose vector.
Definition at line 100 of file vpHomogeneousMatrix.cpp.
References buildFrom().
|
explicit |
Construct an homogeneous matrix from a vector of float.
v | : Vector of 12 or 16 values corresponding to the values of the homogeneous matrix. |
The following example shows how to use this function:
It produces the following printings:
Definition at line 145 of file vpHomogeneousMatrix.cpp.
References buildFrom().
|
explicit |
Construct an homogeneous matrix from a vector of double.
v | : Vector of 12 or 16 values corresponding to the values of the homogeneous matrix. |
The following example shows how to use this function:
It produces the following printings:
Definition at line 190 of file vpHomogeneousMatrix.cpp.
References buildFrom().
vpHomogeneousMatrix::vpHomogeneousMatrix | ( | const double | tx, |
const double | ty, | ||
const double | tz, | ||
const double | tux, | ||
const double | tuy, | ||
const double | tuz | ||
) |
Construct an homogeneous matrix from a translation vector and a rotation vector.
Definition at line 201 of file vpHomogeneousMatrix.cpp.
References buildFrom().
|
inlinevirtual |
Destructor.
Definition at line 108 of file vpHomogeneousMatrix.h.
References vpArray2D< Type >::load(), operator*(), vpArray2D< Type >::operator=(), and vpArray2D< Type >::save().
void vpHomogeneousMatrix::buildFrom | ( | const vpTranslationVector & | t, |
const vpRotationMatrix & | R | ||
) |
Build an homogeneous matrix from a translation vector and a rotation matrix.
Definition at line 223 of file vpHomogeneousMatrix.cpp.
References insert().
Referenced by vpHomography::buildFrom(), vpAfma6::init(), vpViper650::init(), vpViper850::init(), vpSimulatorAfma6::init(), vpSimulatorViper850::init(), vpMbTracker::initClick(), vpMbEdgeMultiTracker::initFromPose(), vpMbKltMultiTracker::initFromPose(), vpMbEdgeKltMultiTracker::initFromPose(), vpMbTracker::initFromPose(), vpWireFrameSimulator::navigation(), vpAfma6::parseConfigFile(), vpXmlParserHomogeneousMatrix::save(), vpPioneerPan::set_cMe(), vpViper::set_eMc(), vpWireFrameSimulator::setExternalCameraPosition(), vpSimulatorPioneer::setVelocity(), vpSimulatorPioneerPan::setVelocity(), vpAfma4::vpAfma4(), vpHomogeneousMatrix(), vpKinect::vpKinect(), and vpWireFrameSimulator::vpWireFrameSimulator().
void vpHomogeneousMatrix::buildFrom | ( | const vpTranslationVector & | t, |
const vpThetaUVector & | tu | ||
) |
Build an homogeneous matrix from a translation vector and a rotation vector.
Definition at line 213 of file vpHomogeneousMatrix.cpp.
References insert().
void vpHomogeneousMatrix::buildFrom | ( | const vpTranslationVector & | t, |
const vpQuaternionVector & | q | ||
) |
Build an homogeneous matrix from a translation vector and a quaternion rotation vector.
Definition at line 245 of file vpHomogeneousMatrix.cpp.
References insert().
void vpHomogeneousMatrix::buildFrom | ( | const vpPoseVector & | p | ) |
Build an homogeneous matrix from a pose vector.
Definition at line 232 of file vpHomogeneousMatrix.cpp.
References insert().
void vpHomogeneousMatrix::buildFrom | ( | const std::vector< float > & | v | ) |
Build an homogeneous matrix from a vector of float.
v | : Vector of 12 or 16 values corresponding to the values of the homogeneous matrix. |
The following example shows how to use this function:
It produces the following printings:
Definition at line 306 of file vpHomogeneousMatrix.cpp.
References vpArray2D< double >::data, and vpException::dimensionError.
void vpHomogeneousMatrix::buildFrom | ( | const std::vector< double > & | v | ) |
Build an homogeneous matrix from a vector of double.
v | : Vector of 12 or 16 values corresponding to the values of the homogeneous matrix. |
The following example shows how to use this function:
It produces the following printings:
Definition at line 356 of file vpHomogeneousMatrix.cpp.
References vpArray2D< double >::data, and vpException::dimensionError.
void vpHomogeneousMatrix::buildFrom | ( | const double | tx, |
const double | ty, | ||
const double | tz, | ||
const double | tux, | ||
const double | tuy, | ||
const double | tuz | ||
) |
Build an homogeneous matrix from a translation vector and a rotation vector.
Definition at line 256 of file vpHomogeneousMatrix.cpp.
References insert().
void vpHomogeneousMatrix::convert | ( | std::vector< float > & | M | ) |
Converts an homogeneous matrix to a vector of 12 floats.
M | : Converted matrix. |
Definition at line 766 of file vpHomogeneousMatrix.cpp.
References vpArray2D< double >::data.
Referenced by vpHomography::inverse().
void vpHomogeneousMatrix::convert | ( | std::vector< double > & | M | ) |
Converts an homogeneous matrix to a vector of 12 doubles.
M | : Converted matrix. |
Definition at line 777 of file vpHomogeneousMatrix.cpp.
References vpArray2D< double >::data.
void vpHomogeneousMatrix::extract | ( | vpRotationMatrix & | R | ) | const |
Extract the rotational matrix from the homogeneous matrix.
R | : rotational component as a rotation matrix. |
Definition at line 553 of file vpHomogeneousMatrix.cpp.
Referenced by vpTranslationVector::buildFrom(), vpPoseVector::buildFrom(), vpThetaUVector::buildFrom(), vpFeatureThetaU::buildFrom(), vpPose::calculArbreDementhon(), vpMatrix::computeCovarianceMatrixVVS(), vpMbtDistanceKltPoints::computeHomography(), vpMbHiddenFaces< PolygonType >::computeScanLineQuery(), vpViper::get_eJe(), vpViper::get_fJe(), vpRobotAfma6::getDisplacement(), vpSimulatorCamera::getPosition(), vpRobotCamera::getPosition(), vpSimulatorPioneer::getPosition(), vpSimulatorPioneerPan::getPosition(), vpSimulatorAfma6::getPosition(), vpRobotAfma4::getPosition(), vpSimulatorViper850::getPosition(), vpRobotAfma6::getPosition(), vpRobotViper650::getPosition(), vpRobotViper850::getPosition(), getRotationMatrix(), getThetaUVector(), getTranslationVector(), vpRobotAfma6::getVelocity(), vpRobotViper650::getVelocity(), vpRobotViper850::getVelocity(), vpExponentialMap::inverse(), inverse(), isAnHomogeneousMatrix(), operator*(), vpPose::poseDementhonNonPlan(), vpPose::poseDementhonPlan(), vpPose::poseLowe(), vpXmlParserHomogeneousMatrix::save(), vpViper::set_eMc(), vpImageSimulator::setCameraPosition(), vpWireFrameSimulator::setExternalCameraPosition(), vpMbKltTracker::setPose(), vpAROgre::setPosition(), vpSimulatorAfma6::setPosition(), vpRobotAfma4::setVelocity(), vpFeatureThetaU::vpFeatureThetaU(), and vpTranslationVector::vpTranslationVector().
void vpHomogeneousMatrix::extract | ( | vpThetaUVector & | tu | ) | const |
Extract the rotation as a vector.
Definition at line 572 of file vpHomogeneousMatrix.cpp.
References vpThetaUVector::buildFrom().
void vpHomogeneousMatrix::extract | ( | vpTranslationVector & | t | ) | const |
Extract the translation vector from the homogeneous matrix.
Definition at line 563 of file vpHomogeneousMatrix.cpp.
void vpHomogeneousMatrix::extract | ( | vpQuaternionVector & | q | ) | const |
Extract the rotation as a quaternion.
Definition at line 582 of file vpHomogeneousMatrix.cpp.
References vpQuaternionVector::buildFrom().
void vpHomogeneousMatrix::eye | ( | ) |
Set transformation to identity.
Definition at line 664 of file vpHomogeneousMatrix.cpp.
Referenced by vpHandEyeCalibration::calibrate(), vpViper::get_eMs(), vpViper::get_wMe(), vpMbKltMultiTracker::initClick(), vpMbTracker::initClick(), vpMbKltMultiTracker::initFromPose(), vpMbKltMultiTracker::reinit(), vpMbKltTracker::reinit(), vpMbDepthDenseTracker::reInitModel(), vpMbDepthNormalTracker::reInitModel(), vpMbKltMultiTracker::reInitModel(), vpMbKltTracker::reInitModel(), vpMbEdgeTracker::reInitModel(), vpMbDepthDenseTracker::resetTracker(), vpMbDepthNormalTracker::resetTracker(), vpMbKltMultiTracker::resetTracker(), vpMbEdgeMultiTracker::resetTracker(), vpMbGenericTracker::resetTracker(), vpMbKltTracker::resetTracker(), vpMbEdgeTracker::resetTracker(), setIdentity(), vpMbKltMultiTracker::setPose(), vpMbEdgeKltMultiTracker::setPose(), vpMbKltTracker::setPose(), vpMbGenericTracker::track(), vpAfma6::vpAfma6(), vpHomogeneousMatrix(), and vpViper::vpViper().
vpColVector vpHomogeneousMatrix::getCol | ( | const unsigned int | j | ) | const |
Extract a column vector from an homogeneous matrix.
j | : Index of the column to extract. If j=0, the first column is extracted. |
The following example shows how to use this function:
It produces the following output:
Definition at line 843 of file vpHomogeneousMatrix.cpp.
References vpException::dimensionError, vpArray2D< double >::getCols(), and vpArray2D< double >::getRows().
|
inlineinherited |
Return the number of columns of the 2D array.
Definition at line 146 of file vpArray2D.h.
References vpArray2D< Type >::colNum, vpArray2D< Type >::getMaxValue(), and vpArray2D< Type >::getMinValue().
Referenced by vpRowVector::cppPrint(), vpMatrix::cppPrint(), vpRowVector::csvPrint(), vpMatrix::csvPrint(), vpMatrix::detByLUEigen3(), vpMatrix::extract(), vpRotationMatrix::getCol(), getCol(), vpMatrix::getCol(), vpMatrix::getRow(), vpMatrix::inverseByLUEigen3(), vpMatrix::inverseByQRLapack(), vpMatrix::kernel(), vpRowVector::maplePrint(), vpMatrix::maplePrint(), vpRowVector::matlabPrint(), vpMatrix::matlabPrint(), vpRowVector::operator*(), vpRowVector::operator+(), vpRowVector::operator+=(), vpRowVector::operator-(), vpRowVector::operator-=(), vpForceTwistMatrix::print(), vpVelocityTwistMatrix::print(), vpRowVector::print(), vpMatrix::print(), vpMatrix::pseudoInverse(), vpMatrix::row(), vpMatrix::svdEigen3(), vpMatrix::svdGsl(), vpMatrix::svdLapack(), and vpMatrix::svdOpenCV().
|
inherited |
Return the array max value.
|
inherited |
Return the array min value.
vpRotationMatrix vpHomogeneousMatrix::getRotationMatrix | ( | ) | const |
Return the rotation matrix from the homogeneous transformation matrix.
Definition at line 797 of file vpHomogeneousMatrix.cpp.
References extract().
Referenced by vpForceTwistMatrix::buildFrom(), vpVelocityTwistMatrix::buildFrom(), vpForceTwistMatrix::vpForceTwistMatrix(), and vpVelocityTwistMatrix::vpVelocityTwistMatrix().
|
inlineinherited |
Return the number of rows of the 2D array.
Definition at line 156 of file vpArray2D.h.
References vpArray2D< Type >::rowNum.
Referenced by vpMatrix::column(), vpColVector::cppPrint(), vpMatrix::cppPrint(), vpColVector::csvPrint(), vpMatrix::csvPrint(), vpMatrix::detByLUEigen3(), vpMatrix::extract(), vpRotationMatrix::getCol(), getCol(), vpMatrix::getCol(), vpMatrix::getRow(), vpMatrix::inverseByCholeskyLapack(), vpMatrix::inverseByLUEigen3(), vpMatrix::inverseByQRLapack(), vpMatrix::kernel(), vpColVector::maplePrint(), vpMatrix::maplePrint(), vpColVector::matlabPrint(), vpMatrix::matlabPrint(), vpColVector::operator+(), vpColVector::operator+=(), vpColVector::operator-(), vpColVector::operator-=(), vpForceTwistMatrix::print(), vpVelocityTwistMatrix::print(), vpPoseVector::print(), vpColVector::print(), vpMatrix::print(), vpMatrix::pseudoInverse(), vpMatrix::svdEigen3(), vpMatrix::svdGsl(), vpMatrix::svdLapack(), and vpMatrix::svdOpenCV().
vpThetaUVector vpHomogeneousMatrix::getThetaUVector | ( | ) | const |
Return the vector that corresponds to the rotation part of the homogeneous transformation.
Definition at line 808 of file vpHomogeneousMatrix.cpp.
References extract().
vpTranslationVector vpHomogeneousMatrix::getTranslationVector | ( | ) | const |
Return the translation vector from the homogeneous transformation matrix.
Definition at line 787 of file vpHomogeneousMatrix.cpp.
References extract().
Referenced by vpForceTwistMatrix::buildFrom(), vpVelocityTwistMatrix::buildFrom(), mean(), and vpAfma6::set_eMc().
Compute the Hadamard product (element wise matrix multiplication).
m | : Second matrix; |
|
inline |
Definition at line 189 of file vpHomogeneousMatrix.h.
Referenced by vpMbGenericTracker::init(), vpMbKltMultiTracker::initClick(), and vpMbEdgeMultiTracker::initFromPose().
void vpHomogeneousMatrix::insert | ( | const vpRotationMatrix & | R | ) |
Insert the rotational component of the homogeneous matrix.
Definition at line 592 of file vpHomogeneousMatrix.cpp.
Referenced by buildFrom(), vpHomography::buildFrom(), vpHandEyeCalibration::calibrate(), vpExponentialMap::direct(), insert(), inverse(), operator*(), vpPose::poseLowe(), and vpHomogeneousMatrix().
void vpHomogeneousMatrix::insert | ( | const vpThetaUVector & | tu | ) |
Insert the rotational component of the homogeneous matrix from a rotation vector.
Definition at line 605 of file vpHomogeneousMatrix.cpp.
References insert().
void vpHomogeneousMatrix::insert | ( | const vpTranslationVector & | t | ) |
Insert the translational component in a homogeneous matrix.
Definition at line 614 of file vpHomogeneousMatrix.cpp.
void vpHomogeneousMatrix::insert | ( | const vpQuaternionVector & | q | ) |
Insert the rotational component of the homogeneous matrix from a quaternion rotation vector.
Definition at line 627 of file vpHomogeneousMatrix.cpp.
References insert().
vpHomogeneousMatrix vpHomogeneousMatrix::inverse | ( | ) | const |
Invert the homogeneous matrix
Definition at line 643 of file vpHomogeneousMatrix.cpp.
References extract(), insert(), and vpRotationMatrix::t().
Referenced by vpVirtualGrabber::acquire(), vpKeyPoint::compute3D(), vpKeyPoint::compute3DForPointsOnCylinders(), vpSimulatorViper850::compute_fMi(), vpMbtFaceDepthNormal::computeDesiredNormalAndCentroid(), vpPtu46::computeMGD(), vpBiclops::computeMGD(), vpPoseFeatures::computePose(), vpMbHiddenFaces< PolygonType >::computeScanLineQuery(), vpMbDepthDenseTracker::computeVVS(), vpMbDepthNormalTracker::computeVVS(), vpMbKltMultiTracker::computeVVS(), vpMbEdgeKltTracker::computeVVS(), vpMbEdgeMultiTracker::computeVVS(), vpMbEdgeKltMultiTracker::computeVVS(), vpMbGenericTracker::computeVVS(), vpMbKltTracker::computeVVS(), vpMbEdgeTracker::computeVVS(), vpMbEdgeMultiTracker::computeVVSFirstPhasePoseEstimation(), vpMbEdgeTracker::computeVVSFirstPhasePoseEstimation(), vpMbKltMultiTracker::computeVVSInteractionMatrixAndResidu(), vpMbEdgeKltMultiTracker::computeVVSInteractionMatrixAndResidu(), vpProjectionDisplay::displayCamera(), vpPtu46::get_cMe(), vpAfma4::get_cMe(), vpViper::get_cMe(), vpAfma6::get_cMe(), vpRobotWireFrameSimulator::get_cMo(), vpAfma4::get_cVf(), vpViper::get_eJe(), vpViper::get_fJe(), vpBiclops::get_fMc(), vpRobotBiclops::getDisplacement(), vpRobotAfma6::getDisplacement(), vpSimulator::getExternalCameraPosition(), vpSimulatorAfma6::getExternalImage(), vpSimulatorViper850::getExternalImage(), vpWireFrameSimulator::getExternalImage(), vpRobotFranka::getForceTorque(), vpWireFrameSimulator::getInternalImage(), vpRobotWireFrameSimulator::getInternalView(), vpViper::getInverseKinematics(), vpAfma6::getInverseKinematics(), vpRobotAfma4::getVelocity(), vpRobotAfma6::getVelocity(), vpRobotViper650::getVelocity(), vpRobotViper850::getVelocity(), vpSimulatorAfma6::initialiseCameraRelativeToObject(), vpSimulatorViper850::initialiseCameraRelativeToObject(), inverse(), vpSimulator::moveInternalCamera(), vpPose::poseVirtualVS(), vpPose::poseVirtualVSrobust(), vpWireFrameSimulator::projectCameraTrajectory(), vpBiclops::set_cMe(), vpPioneerPan::set_cMe(), vpWireFrameSimulator::setCameraPositionRelObj(), vpWireFrameSimulator::setCameraPositionRelWorld(), vpWireFrameSimulator::setExternalCameraPosition(), vpMbKltTracker::setPose(), vpSimulatorAfma6::setPosition(), vpRobotCamera::setVelocity(), vpSimulatorPioneer::setVelocity(), vpSimulatorPioneerPan::setVelocity(), vpMbGenericTracker::track(), vpKinect::vpKinect(), vpSimulatorPioneer::vpSimulatorPioneer(), and vpSimulatorPioneerPan::vpSimulatorPioneerPan().
void vpHomogeneousMatrix::inverse | ( | vpHomogeneousMatrix & | M | ) | const |
Invert the homogeneous matrix.
M | : The inverted homogeneous matrix: |
Definition at line 691 of file vpHomogeneousMatrix.cpp.
References inverse().
bool vpHomogeneousMatrix::isAnHomogeneousMatrix | ( | ) | const |
Test if the 3x3 rotational part of the homogeneous matrix is really a rotation matrix.
Definition at line 541 of file vpHomogeneousMatrix.cpp.
References extract(), and vpRotationMatrix::isARotationMatrix().
void vpHomogeneousMatrix::load | ( | std::ifstream & | f | ) |
Read an homogeneous matrix from an input file stream. The homogeneous matrix is considered as a 4 by 4 matrix.
f | : Input file stream. |
The code below shows how to get an homogeneous matrix from a file.
Definition at line 742 of file vpHomogeneousMatrix.cpp.
References vpException::ioError.
|
inlinestaticinherited |
Load a matrix from a file.
filename | : Absolute file name. |
A | : Array to be loaded |
binary | : If true the matrix is loaded from a binary file, else from a text file. |
header | : Header of the file is loaded in this parameter. |
Definition at line 322 of file vpArray2D.h.
References vpException::badValue, and vpArray2D< Type >::resize().
|
inlinestaticinherited |
Load an array from a YAML-formatted file.
filename | : absolute file name. |
A | : array to be loaded from the file. |
header | : header of the file is loaded in this parameter. |
Definition at line 434 of file vpArray2D.h.
References vpArray2D< Type >::resize().
|
static |
Compute the Euclidean mean of the homogeneous matrices. The Euclidean mean of the rotation matrices is computed following Moakher's method (SIAM 2002).
[in] | vec_M | : Set of homogeneous matrices. |
Definition at line 863 of file vpHomogeneousMatrix.cpp.
References getTranslationVector(), vpMatrix::pseudoInverse(), and vpMatrix::t().
vpHomogeneousMatrix vpHomogeneousMatrix::operator* | ( | const vpHomogeneousMatrix & | M | ) | const |
Operator that allow to multiply an homogeneous matrix by an other one.
Definition at line 398 of file vpHomogeneousMatrix.cpp.
vpColVector vpHomogeneousMatrix::operator* | ( | const vpColVector & | v | ) | const |
Operator that allow to multiply an homogeneous matrix by a 4-dimension column vector.
vpException::dimensionError | : If the vector v is not a 4-dimension vector. |
Definition at line 451 of file vpHomogeneousMatrix.cpp.
References vpException::dimensionError, vpArray2D< Type >::getRows(), vpArray2D< double >::rowNum, and vpArray2D< double >::rowPtrs.
vpTranslationVector vpHomogeneousMatrix::operator* | ( | const vpTranslationVector & | t | ) | const |
Since a translation vector could be seen as the origin point of a frame, this function computes the new coordinates of a translation vector after applying an homogeneous transformation.
t | : Translation vector seen as the 3D coordinates of a point. |
Definition at line 525 of file vpHomogeneousMatrix.cpp.
From the coordinates of the point in camera frame b and the transformation between camera frame a and camera frame b computes the coordinates of the point in camera frame a.
bP | : 3D coordinates of the point in camera frame bP. |
Definition at line 483 of file vpHomogeneousMatrix.cpp.
References vpPoint::get_W(), vpPoint::get_X(), vpPoint::get_Y(), vpPoint::get_Z(), vpPoint::set_oW(), vpPoint::set_oX(), vpPoint::set_oY(), vpPoint::set_oZ(), vpPoint::set_W(), vpPoint::set_X(), vpPoint::set_Y(), and vpPoint::set_Z().
vpHomogeneousMatrix & vpHomogeneousMatrix::operator*= | ( | const vpHomogeneousMatrix & | M | ) |
Operator that allow to multiply an homogeneous matrix by an other one.
Definition at line 438 of file vpHomogeneousMatrix.cpp.
vpHomogeneousMatrix & vpHomogeneousMatrix::operator= | ( | const vpHomogeneousMatrix & | M | ) |
Copy operator that allows to set an homogeneous matrix from an other one.
M | : Matrix to copy. |
Definition at line 371 of file vpHomogeneousMatrix.cpp.
References vpArray2D< double >::rowPtrs, and vpArray2D< Type >::rowPtrs.
|
inlineinherited |
Set element using A[i][j] = x.
Definition at line 266 of file vpArray2D.h.
|
inlineinherited |
Get element using x = A[i][j].
Definition at line 268 of file vpArray2D.h.
void vpHomogeneousMatrix::print | ( | ) | const |
Print the matrix as a pose vector .
Definition at line 756 of file vpHomogeneousMatrix.cpp.
References vpPoseVector::t().
|
inline |
This function is not applicable to an homogeneous matrix that is always a 4-by-4 matrix.
vpException::fatalError | When this function is called. |
Definition at line 170 of file vpHomogeneousMatrix.h.
References vpException::fatalError.
|
inlineinherited |
Set the size of the array and initialize all the values to zero.
nrows | : number of rows. |
ncols | : number of column. |
flagNullify | : if true, then the array is re-initialized to 0 after resize. If false, the initial values from the common part of the array (common part between old and new version of the array) are kept. Default value is true. |
recopy_ | : if true, will perform an explicit recopy of the old data if needed and if flagNullify is set to false. |
Definition at line 171 of file vpArray2D.h.
References vpArray2D< Type >::colNum, vpArray2D< Type >::dsize, vpException::memoryAllocationError, vpArray2D< Type >::rowNum, and vpArray2D< Type >::rowPtrs.
Referenced by vpMatrix::diag(), vpMatrix::eye(), vpMatrix::init(), vpMatrix::operator=(), vpMatrix::stack(), and vpMatrix::svdOpenCV().
void vpHomogeneousMatrix::save | ( | std::ofstream & | f | ) | const |
Write an homogeneous matrix in an output file stream.
f | : Output file stream. The homogeneous matrix is saved as a 4 by 4 matrix. |
The code below shows how to save an homogeneous matrix in a file.
Definition at line 715 of file vpHomogeneousMatrix.cpp.
References vpException::ioError.
Referenced by vpViewer::resize().
|
inlinestaticinherited |
Save a matrix to a file.
filename | : Absolute file name. |
A | : Array to be saved. |
binary | : If true the matrix is saved in a binary file, else a text file. |
header | : Optional line that will be saved at the beginning of the file. |
Warning : If you save the matrix as in a text file the precision is less than if you save it in a binary file.
Definition at line 519 of file vpArray2D.h.
References vpArray2D< Type >::getCols(), and vpArray2D< Type >::getRows().
|
inlinestaticinherited |
Save an array in a YAML-formatted file.
filename | : absolute file name. |
A | : array to be saved in the file. |
header | : optional lines that will be saved at the beginning of the file. Should be YAML-formatted and will adapt to the indentation if any. |
Here is an example of outputs.
Content of matrix.yml:
Content of matrixIndent.yml:
Definition at line 612 of file vpArray2D.h.
References vpArray2D< Type >::getCols(), and vpArray2D< Type >::getRows().
void vpHomogeneousMatrix::setIdentity | ( | ) |
Set homogeneous matrix to identity.
Definition at line 906 of file vpHomogeneousMatrix.cpp.
References eye().
|
inlineinherited |
Return the number of elements of the 2D array.
Definition at line 158 of file vpArray2D.h.
References vpArray2D< Type >::rowNum.
Referenced by vpRowVector::insert(), vpColVector::insert(), vpColVector::operator*(), vpMatrix::stack(), vpRotationVector::toStdVector(), vpRowVector::toStdVector(), and vpColVector::toStdVector().
|
related |
Enumeration of the operations applied on matrices in vpGEMM() function.
Operations are :
|
protectedinherited |
Number of columns in the array.
Definition at line 76 of file vpArray2D.h.
Referenced by vpMatrix::AAt(), vpMatrix::AtA(), vpColVector::clear(), vpMatrix::detByLU(), vpMatrix::detByLUEigen3(), vpMatrix::detByLUGsl(), vpMatrix::detByLULapack(), vpMatrix::detByLUOpenCV(), vpMatrix::diag(), vpMatrix::eigenValues(), vpMatrix::expm(), vpMatrix::eye(), vpMatrix::getRow(), vpColVector::hadamard(), vpMatrix::hadamard(), vpMatrix::infinityNorm(), vpSubColVector::init(), vpSubRowVector::init(), vpSubMatrix::init(), vpRowVector::insert(), vpMatrix::insert(), vpMatrix::inverseByCholeskyLapack(), vpMatrix::inverseByCholeskyOpenCV(), vpMatrix::inverseByLUEigen3(), vpMatrix::inverseByLUGsl(), vpMatrix::inverseByLULapack(), vpMatrix::inverseByLUOpenCV(), vpMatrix::inverseByQRLapack(), vpMatrix::inverseTriangular(), vpRotationMatrix::operator*(), vpRowVector::operator*(), vpMatrix::operator*(), vpRotationMatrix::operator*=(), vpRowVector::operator*=(), vpMatrix::operator*=(), vpRowVector::operator+(), vpRowVector::operator+=(), vpMatrix::operator+=(), vpRowVector::operator-(), vpRowVector::operator-=(), vpMatrix::operator-=(), vpRowVector::operator/(), vpMatrix::operator/(), vpRowVector::operator/=(), vpMatrix::operator/=(), vpMatrix::operator<<(), vpColVector::operator<<(), vpSubRowVector::operator=(), vpSubMatrix::operator=(), vpRowVector::operator=(), vpColVector::operator=(), vpMatrix::operator=(), vpColVector::operator==(), vpMatrix::qr(), vpMatrix::qrPivot(), vpRowVector::reshape(), vpMatrix::setIdentity(), vpMatrix::solveByQR(), vpMatrix::solveBySVD(), vpMatrix::stack(), vpRowVector::stack(), vpMatrix::stackColumns(), vpMatrix::stackRows(), vpRowVector::sum(), vpMatrix::sum(), vpRowVector::sumSquare(), vpMatrix::sumSquare(), vpRowVector::t(), vpMatrix::t(), vpMatrix::transpose(), vpColVector::vpColVector(), and vpMatrix::vpMatrix().
|
inherited |
Address of the first element of the data array.
Definition at line 84 of file vpArray2D.h.
Referenced by vpMatrix::AtA(), vpQuaternionVector::buildFrom(), buildFrom(), vpRzyzVector::buildFrom(), vpThetaUVector::buildFrom(), vpRxyzVector::buildFrom(), vpRzyxVector::buildFrom(), vpSubColVector::checkParentStatus(), vpSubRowVector::checkParentStatus(), vpSubMatrix::checkParentStatus(), vpColVector::clear(), convert(), vpMatrix::detByLUEigen3(), vpMatrix::detByLUOpenCV(), vpTranslationVector::euclideanNorm(), vpRowVector::euclideanNorm(), vpMatrix::euclideanNorm(), vpMatrix::expm(), vpThetaUVector::extract(), vpMatrix::getRow(), vpThetaUVector::getTheta(), vpThetaUVector::getU(), vpColVector::hadamard(), vpMatrix::hadamard(), vpSubColVector::init(), vpSubRowVector::init(), vpSubMatrix::init(), vpColVector::insert(), vpMatrix::insert(), vpMatrix::inverseByCholeskyOpenCV(), vpMatrix::inverseByLUEigen3(), vpMatrix::inverseByLUOpenCV(), vpTranslationVector::operator*(), vpRowVector::operator*(), vpColVector::operator*(), vpHomography::operator*(), vpMatrix::operator*(), vpTranslationVector::operator-(), vpRowVector::operator-(), vpColVector::operator-(), vpTranslationVector::operator/(), vpRowVector::operator/(), vpColVector::operator/(), vpHomography::operator/(), vpHomography::operator/=(), vpSubColVector::operator=(), vpSubRowVector::operator=(), vpQuaternionVector::operator=(), vpTranslationVector::operator=(), vpRowVector::operator=(), vpRzyzVector::operator=(), vpRxyzVector::operator=(), vpRzyxVector::operator=(), vpColVector::operator=(), vpMatrix::operator=(), vpThetaUVector::operator=(), vpColVector::operator==(), vpColVector::operator[](), vpMatrix::qr(), vpMatrix::qrPivot(), vpRowVector::reshape(), vpColVector::reshape(), vpQuaternionVector::set(), vpMatrix::stack(), vpMatrix::stackRows(), vpColVector::sum(), vpColVector::sumSquare(), vpMatrix::svdEigen3(), vpMatrix::svdGsl(), vpMatrix::svdLapack(), vpMatrix::svdOpenCV(), vpRotationVector::t(), vpTranslationVector::t(), vpPoseVector::t(), vpRowVector::t(), vpColVector::t(), vpRotationVector::toStdVector(), vpRowVector::toStdVector(), vpColVector::toStdVector(), vpColVector::vpColVector(), vpMatrix::vpMatrix(), vpQuaternionVector::w(), vpQuaternionVector::x(), vpQuaternionVector::y(), vpQuaternionVector::z(), vpSubColVector::~vpSubColVector(), vpSubMatrix::~vpSubMatrix(), and vpSubRowVector::~vpSubRowVector().
|
protectedinherited |
Current array size (rowNum * colNum)
Definition at line 80 of file vpArray2D.h.
Referenced by vpColVector::clear(), vpTranslationVector::euclideanNorm(), vpRowVector::euclideanNorm(), vpMatrix::euclideanNorm(), vpColVector::hadamard(), vpMatrix::hadamard(), vpSubColVector::init(), vpSubRowVector::init(), vpSubMatrix::init(), vpTranslationVector::operator*(), vpRotationVector::operator*(), vpTranslationVector::operator-(), vpTranslationVector::operator/(), vpRzyzVector::operator=(), vpRxyzVector::operator=(), vpRzyxVector::operator=(), vpColVector::operator=(), vpMatrix::operator=(), vpThetaUVector::operator=(), vpRowVector::reshape(), vpColVector::reshape(), vpMatrix::stackRows(), vpRotationVector::t(), vpColVector::vpColVector(), and vpMatrix::vpMatrix().
|
protectedinherited |
Number of rows in the array.
Definition at line 74 of file vpArray2D.h.
Referenced by vpMatrix::AAt(), vpMatrix::AtA(), vpColVector::clear(), vpMatrix::detByLU(), vpMatrix::detByLUEigen3(), vpMatrix::detByLUGsl(), vpMatrix::detByLULapack(), vpMatrix::detByLUOpenCV(), vpMatrix::diag(), vpMatrix::eigenValues(), vpMatrix::expm(), vpColVector::extract(), vpMatrix::eye(), vpColVector::hadamard(), vpMatrix::hadamard(), vpColVector::infinityNorm(), vpMatrix::infinityNorm(), vpSubColVector::init(), vpSubRowVector::init(), vpSubMatrix::init(), vpMatrix::insert(), vpMatrix::inverseByCholeskyLapack(), vpMatrix::inverseByCholeskyOpenCV(), vpMatrix::inverseByLUEigen3(), vpMatrix::inverseByLUGsl(), vpMatrix::inverseByLULapack(), vpMatrix::inverseByLUOpenCV(), vpMatrix::inverseByQRLapack(), vpMatrix::inverseTriangular(), vpRotationMatrix::operator*(), vpTranslationVector::operator*(), operator*(), vpColVector::operator*(), vpMatrix::operator*(), vpRotationMatrix::operator*=(), vpTranslationVector::operator*=(), vpColVector::operator*=(), vpMatrix::operator*=(), vpColVector::operator+(), vpColVector::operator+=(), vpMatrix::operator+=(), vpColVector::operator-(), vpColVector::operator-=(), vpMatrix::operator-=(), vpColVector::operator/(), vpMatrix::operator/(), vpTranslationVector::operator/=(), vpColVector::operator/=(), vpMatrix::operator/=(), vpMatrix::operator<<(), vpColVector::operator<<(), vpSubColVector::operator=(), vpSubRowVector::operator=(), vpSubMatrix::operator=(), vpTranslationVector::operator=(), vpRowVector::operator=(), vpColVector::operator=(), vpMatrix::operator=(), vpColVector::operator==(), vpMatrix::qr(), vpMatrix::qrPivot(), vpColVector::reshape(), vpMatrix::setIdentity(), vpMatrix::stack(), vpColVector::stack(), vpMatrix::stackColumns(), vpMatrix::stackRows(), vpColVector::sum(), vpMatrix::sum(), vpRotationVector::sumSquare(), vpTranslationVector::sumSquare(), vpColVector::sumSquare(), vpMatrix::sumSquare(), vpTranslationVector::t(), vpPoseVector::t(), vpColVector::t(), vpMatrix::t(), vpMatrix::transpose(), vpColVector::vpColVector(), and vpMatrix::vpMatrix().
|
protectedinherited |
Address of the first element of each rows.
Definition at line 78 of file vpArray2D.h.
Referenced by vpMatrix::AAt(), vpColVector::clear(), vpMatrix::infinityNorm(), vpSubColVector::init(), vpSubRowVector::init(), vpSubMatrix::init(), vpRowVector::init(), vpColVector::init(), vpMatrix::init(), vpRotationMatrix::operator*(), vpForceTwistMatrix::operator*(), vpVelocityTwistMatrix::operator*(), operator*(), vpMatrix::operator*(), vpRotationMatrix::operator*=(), vpMatrix::operator*=(), vpMatrix::operator+=(), vpMatrix::operator-=(), vpMatrix::operator/(), vpMatrix::operator/=(), vpMatrix::operator<<(), vpColVector::operator<<(), vpSubMatrix::operator=(), vpRotationMatrix::operator=(), operator=(), vpForceTwistMatrix::operator=(), vpVelocityTwistMatrix::operator=(), vpRowVector::operator=(), vpColVector::operator=(), vpMatrix::operator=(), vpMatrix::stack(), vpMatrix::stackColumns(), vpRowVector::sum(), vpMatrix::sum(), vpRotationVector::sumSquare(), vpTranslationVector::sumSquare(), vpRowVector::sumSquare(), vpMatrix::sumSquare(), vpMatrix::transpose(), vpColVector::vpColVector(), and vpMatrix::vpMatrix().