Classes | Public Member Functions | Friends

ntk::Pose3D Class Reference

#include <pose_3d.h>

List of all members.

Classes

class  PrivatePose3D

Public Member Functions

 Pose3D ()
 ~Pose3D ()
 Pose3D (const Pose3D &rhs)
Pose3Doperator= (const Pose3D &rhs)
virtual void saveToYaml (cv::FileStorage &yaml) const
virtual void loadFromYaml (cv::FileNode yaml)
void setCameraParametersFromOpencv (const cv::Mat1d &cv_matrix)
void setCameraParameters (double fx, double fy, double cx, double cy, bool orthographic=false)
void toLeftCamera (const cv::Mat1d &intrinsics_matrix, const cv::Mat1d &R, const cv::Mat1d &T)
void toRightCamera (const cv::Mat1d &cv_matrix, const cv::Mat1d &R, const cv::Mat1d &T)
Pose3D computeDeltaPoseWith (const Pose3D &new_pose) const
double focalX () const
double focalY () const
double imageCenterX () const
double imageCenterY () const
bool focalAreIdentical () const
double meanFocal () const
bool isValid () const
void setOrthographic (bool ortho)
bool isOrthographic () const
const cv::Vec3f cvTranslation () const
const cv::Vec3f cvEulerRotation () const
const cv::Vec3f cvRodriguesRotation () const
const cv::Mat1f cvCameraTransform () const
cv::Mat1f cvInvCameraTransform () const
cv::Mat1f cvProjectionMatrix () const
cv::Mat1f cvInvProjectionMatrix () const
void resetCameraTransform ()
void invert ()
void setCameraTransform (const cv::Mat1d &tvec, const cv::Mat1d &rvec)
void setCameraTransform (const cv::Mat1f &H)
void setCameraTransformFromCvFundamentalMatrix (const cv::Mat1f &F)
void applyTransformBefore (const Pose3D &rhs_pose)
void applyTransformBefore (const cv::Vec3f &cvTranslation, const cv::Vec3f &rotation_euler_angles)
void applyTransformBefore (const cv::Vec3f &cvTranslation, const cv::Mat1d &rotation_matrix)
void applyTransformBeforeRodrigues (const cv::Vec3f &cvTranslation, const cv::Vec3f &rotation_rodrigues)
void applyTransformAfter (const Pose3D &rhs_pose)
void applyTransformAfter (const cv::Vec3f &translation, const cv::Vec3f &rotation_euler_angles)
void applyTransformAfter (const cv::Vec3f &translation, const cv::Mat1d &rotation_matrix)
void applyTransformAfterRodrigues (const cv::Vec3f &translation, const cv::Vec3f &rotation_rodrigues)
cv::Point3f cameraTransform (const cv::Point3f &p) const
cv::Point3f invCameraTransform (const cv::Point3f &p) const
cv::Point3f projectToImage (const cv::Point3f &p) const
void projectToImage (const cv::Mat3f &voxels, const cv::Mat1b &mask, cv::Mat3f &pixels) const
cv::Point3f unprojectFromImage (const cv::Point2f &p, double depth) const
cv::Point3f unprojectFromImage (const cv::Point3f &p) const
void unprojectFromImage (const cv::Mat1f &pixels, const cv::Mat1b &mask, cv::Mat3f &voxels) const

Friends

class PrivatePose3D

Detailed Description

Represent transformations within a Pin-Hole or orthographic camera model. Can be used both for 3D camera transforms and projections on an image plane using perspective or othogonal model.


Constructor & Destructor Documentation

ntk::Pose3D::Pose3D (  ) 
ntk::Pose3D::~Pose3D (  ) 
ntk::Pose3D::Pose3D ( const Pose3D rhs  ) 

Member Function Documentation

void ntk::Pose3D::applyTransformAfter ( const Pose3D rhs_pose  ) 

Apply a camera transform on the left.

void ntk::Pose3D::applyTransformAfter ( const cv::Vec3f &  translation,
const cv::Vec3f &  rotation_euler_angles 
)
void ntk::Pose3D::applyTransformAfter ( const cv::Vec3f &  translation,
const cv::Mat1d &  rotation_matrix 
)
void ntk::Pose3D::applyTransformAfterRodrigues ( const cv::Vec3f &  translation,
const cv::Vec3f &  rotation_rodrigues 
)
void ntk::Pose3D::applyTransformBefore ( const cv::Vec3f &  cvTranslation,
const cv::Mat1d &  rotation_matrix 
)
void ntk::Pose3D::applyTransformBefore ( const Pose3D rhs_pose  ) 

Apply a camera transform on the right.

void ntk::Pose3D::applyTransformBefore ( const cv::Vec3f &  cvTranslation,
const cv::Vec3f &  rotation_euler_angles 
)
void ntk::Pose3D::applyTransformBeforeRodrigues ( const cv::Vec3f &  cvTranslation,
const cv::Vec3f &  rotation_rodrigues 
)
cv::Point3f ntk::Pose3D::cameraTransform ( const cv::Point3f &  p  )  const

Apply the camera transform on a given 3D point.

Pose3D ntk::Pose3D::computeDeltaPoseWith ( const Pose3D new_pose  )  const

Compute the delta camera transform with another pose.

const cv::Mat1f ntk::Pose3D::cvCameraTransform (  )  const

Returns the camera transform as an OpenCV 4x4 matrix.

const cv::Vec3f ntk::Pose3D::cvEulerRotation (  )  const

Returns the camera rotation as OpenCV vector of euler angles. First angle is around X, second around Y and third around Z.

cv::Mat1f ntk::Pose3D::cvInvCameraTransform (  )  const

Returns the inverse camera transform as an OpenCV 4x4 matrix.

cv::Mat1f ntk::Pose3D::cvInvProjectionMatrix (  )  const

Returns the 4x4 inverse projection matrix from image to plane.

cv::Mat1f ntk::Pose3D::cvProjectionMatrix (  )  const

Returns the 4x4 projection matrix (intrinsics * camera)

const cv::Vec3f ntk::Pose3D::cvRodriguesRotation (  )  const

Returns the camera rotation as a rodrigues vector.

const cv::Vec3f ntk::Pose3D::cvTranslation (  )  const

Returns the camera translation as OpenCV 3x3 matrix.

bool ntk::Pose3D::focalAreIdentical (  )  const [inline]

Whether pixels have square size.

double ntk::Pose3D::focalX (  )  const [inline]

Focal lenghts in pixels.

double ntk::Pose3D::focalY (  )  const [inline]
double ntk::Pose3D::imageCenterX (  )  const [inline]

Image plane center.

double ntk::Pose3D::imageCenterY (  )  const [inline]
cv::Point3f ntk::Pose3D::invCameraTransform ( const cv::Point3f &  p  )  const

Apply the inverse camera transform on a given 3D point.

void ntk::Pose3D::invert (  ) 

Invert the camera transform.

bool ntk::Pose3D::isOrthographic (  )  const [inline]
bool ntk::Pose3D::isValid (  )  const [inline]

Whether it can be used as a complete camera model.

virtual void ntk::Pose3D::loadFromYaml ( cv::FileNode  yaml  )  [virtual]
double ntk::Pose3D::meanFocal (  )  const [inline]

Mean focal.

Pose3D & ntk::Pose3D::operator= ( const Pose3D rhs  ) 
void ntk::Pose3D::projectToImage ( const cv::Mat3f &  voxels,
const cv::Mat1b &  mask,
cv::Mat3f &  pixels 
) const

Project a set of 3D points onto image plane.

cv::Point3f ntk::Pose3D::projectToImage ( const cv::Point3f &  p  )  const

Project a 3D point to image plane.

void ntk::Pose3D::resetCameraTransform (  ) 

Reset the camera transform to Identity.

virtual void ntk::Pose3D::saveToYaml ( cv::FileStorage &  yaml  )  const [virtual]
void ntk::Pose3D::setCameraParameters ( double  fx,
double  fy,
double  cx,
double  cy,
bool  orthographic = false 
)

Set parameters from intrinsics matrix.

void ntk::Pose3D::setCameraParametersFromOpencv ( const cv::Mat1d &  cv_matrix  ) 

Set parameters from intrinsics matrix.

void ntk::Pose3D::setCameraTransform ( const cv::Mat1d &  tvec,
const cv::Mat1d &  rvec 
)

Set the 3D camera transformation from OpenCV translation and rodrigues vector.

void ntk::Pose3D::setCameraTransform ( const cv::Mat1f &  H  ) 

Set the 3D camera transform from 4x4 matrix.

void ntk::Pose3D::setCameraTransformFromCvFundamentalMatrix ( const cv::Mat1f &  F  ) 

Set the 3D camera transform from 3x3 fundamental matrix.

Compute 3D rotation and translation from a fundamental matrix. Assumes both images come from the same camera. See http://en.wikipedia.org/wiki/Essential_matrix for details. WARNING 1: the translation is known up to a scale. WARNING 2: this implementation is not tested and is probably wrong.

void ntk::Pose3D::setOrthographic ( bool  ortho  ) 

Change from pin-hole to orthographic model.

void ntk::Pose3D::toLeftCamera ( const cv::Mat1d &  intrinsics_matrix,
const cv::Mat1d &  R,
const cv::Mat1d &  T 
)

Transform a right camera into a left camera using stereo parameters.

Parameters:
intrinsics_matrix intrinsics matrix of the left camera.
R extrinsics 3x3 rotation matrix.
T extrinsics 1x3 translation matrix.
See also:
RGBDCalibration
void ntk::Pose3D::toRightCamera ( const cv::Mat1d &  cv_matrix,
const cv::Mat1d &  R,
const cv::Mat1d &  T 
)

Transform a left camera into a right camera using stereo parameters.

See also:
toLeftCamera
cv::Point3f ntk::Pose3D::unprojectFromImage ( const cv::Point2f &  p,
double  depth 
) const

Project a point from image plane to 3D using the given depth.

void ntk::Pose3D::unprojectFromImage ( const cv::Mat1f &  pixels,
const cv::Mat1b &  mask,
cv::Mat3f &  voxels 
) const

Project a set of image points to 3D.

cv::Point3f ntk::Pose3D::unprojectFromImage ( const cv::Point3f &  p  )  const [inline]

Friends And Related Function Documentation

friend class PrivatePose3D [friend]

The documentation for this class was generated from the following files: