OKVIS ROS
|
#include <PinholeCamera.hpp>
Public Member Functions | |
PinholeCamera (int imageWidth, int imageHeight, double focalLengthU, double focalLengthV, double imageCenterU, double imageCenterV, const distortion_t &distortion, uint64_t id=-1) | |
Constructor that will figure out the type of distortion. More... | |
~PinholeCamera () | |
Destructor. More... | |
double | focalLengthU () const |
Get the focal length along the u-dimension. More... | |
double | focalLengthV () const |
Get the focal length along the v-dimension. More... | |
double | imageCenterU () const |
Get the image centre along the u-dimension. More... | |
double | imageCenterV () const |
Get the focal image centre along the v-dimension. More... | |
void | getIntrinsics (Eigen::VectorXd &intrinsics) const |
Get the intrinsics as a concatenated vector. More... | |
bool | setIntrinsics (const Eigen::VectorXd &intrinsics) |
overwrite all intrinsics - use with caution ! More... | |
int | noIntrinsicsParameters () const |
Get the total number of intrinsics. More... | |
std::string | type () const |
Obtain the projection type. More... | |
const std::string | distortionType () const |
Obtain the projection type. More... | |
Methods to project points | |
CameraBase::ProjectionStatus | project (const Eigen::Vector3d &point, Eigen::Vector2d *imagePoint) const |
Projects a Euclidean point to a 2d image point (projection). Uses projection including distortion models. More... | |
CameraBase::ProjectionStatus | project (const Eigen::Vector3d &point, Eigen::Vector2d *imagePoint, Eigen::Matrix< double, 2, 3 > *pointJacobian, Eigen::Matrix2Xd *intrinsicsJacobian=NULL) const |
Projects a Euclidean point to a 2d image point (projection). Uses projection including distortion models. More... | |
CameraBase::ProjectionStatus | projectWithExternalParameters (const Eigen::Vector3d &point, const Eigen::VectorXd ¶meters, Eigen::Vector2d *imagePoint, Eigen::Matrix< double, 2, 3 > *pointJacobian, Eigen::Matrix2Xd *intrinsicsJacobian=NULL) const |
Projects a Euclidean point to a 2d image point (projection). Uses projection including distortion models. More... | |
void | projectBatch (const Eigen::Matrix3Xd &points, Eigen::Matrix2Xd *imagePoints, std::vector< CameraBase::ProjectionStatus > *stati) const |
Projects Euclidean points to 2d image points (projection) in a batch. Uses projection including distortion models. More... | |
CameraBase::ProjectionStatus | projectHomogeneous (const Eigen::Vector4d &point, Eigen::Vector2d *imagePoint) const |
Projects a point in homogenous coordinates to a 2d image point (projection). Uses projection including distortion models. More... | |
CameraBase::ProjectionStatus | projectHomogeneous (const Eigen::Vector4d &point, Eigen::Vector2d *imagePoint, Eigen::Matrix< double, 2, 4 > *pointJacobian, Eigen::Matrix2Xd *intrinsicsJacobian=NULL) const |
Projects a point in homogenous coordinates to a 2d image point (projection). Uses projection including distortion models. More... | |
CameraBase::ProjectionStatus | projectHomogeneousWithExternalParameters (const Eigen::Vector4d &point, const Eigen::VectorXd ¶meters, Eigen::Vector2d *imagePoint, Eigen::Matrix< double, 2, 4 > *pointJacobian=NULL, Eigen::Matrix2Xd *intrinsicsJacobian=NULL) const |
Projects a point in homogenous coordinates to a 2d image point (projection). Uses projection including distortion models. More... | |
void | projectHomogeneousBatch (const Eigen::Matrix4Xd &points, Eigen::Matrix2Xd *imagePoints, std::vector< CameraBase::ProjectionStatus > *stati) const |
Projects points in homogenous coordinates to 2d image points (projection) in a batch. Uses projection including distortion models. More... | |
Methods to backproject points | |
bool | backProject (const Eigen::Vector2d &imagePoint, Eigen::Vector3d *direction) const |
Back-project a 2d image point into Euclidean space (direction vector). More... | |
bool | backProject (const Eigen::Vector2d &imagePoint, Eigen::Vector3d *direction, Eigen::Matrix< double, 3, 2 > *pointJacobian) const |
Back-project a 2d image point into Euclidean space (direction vector). More... | |
bool | backProjectBatch (const Eigen::Matrix2Xd &imagePoints, Eigen::Matrix3Xd *directions, std::vector< bool > *success) const |
Back-project 2d image points into Euclidean space (direction vectors). More... | |
bool | backProjectHomogeneous (const Eigen::Vector2d &imagePoint, Eigen::Vector4d *direction) const |
Back-project a 2d image point into homogeneous point (direction vector). More... | |
bool | backProjectHomogeneous (const Eigen::Vector2d &imagePoint, Eigen::Vector4d *direction, Eigen::Matrix< double, 4, 2 > *pointJacobian) const |
Back-project a 2d image point into homogeneous point (direction vector). More... | |
bool | backProjectHomogeneousBatch (const Eigen::Matrix2Xd &imagePoints, Eigen::Matrix4Xd *directions, std::vector< bool > *success) const |
Back-project 2d image points into homogeneous points (direction vectors). More... | |
Public Member Functions inherited from okvis::cameras::CameraBase | |
CameraBase () | |
default Constructor – does nothing serious More... | |
CameraBase (int imageWidth, int imageHeight, uint64_t id=0) | |
Constructor for width, height and Id. More... | |
virtual | ~CameraBase () |
Destructor – does nothing. More... | |
uint32_t | imageWidth () const |
The width of the image in pixels. More... | |
uint32_t | imageHeight () const |
The height of the image in pixels. More... | |
bool | setMask (const cv::Mat &mask) |
Set the mask. It must be the same size as the image and comply with OpenCV: 0 == masked, nonzero == valid. Type must be CV_8U1C. More... | |
bool | hasMask () const |
Was a nonzero mask set? More... | |
bool | removeMask () |
stop masking More... | |
const cv::Mat & | mask () const |
Get the mask. More... | |
void | setId (uint64_t id) |
Set an Id. More... | |
uint64_t | id () const |
Obtain the Id. More... | |
virtual void | projectBatch (const Eigen::Matrix3Xd &points, Eigen::Matrix2Xd *imagePoints, std::vector< ProjectionStatus > *stati) const =0 |
Projects Euclidean points to 2d image points (projection) in a batch. Uses projection including distortion models. More... | |
virtual void | projectHomogeneousBatch (const Eigen::Matrix4Xd &points, Eigen::Matrix2Xd *imagePoints, std::vector< ProjectionStatus > *stati) const =0 |
Projects points in homogenous coordinates to 2d image points (projection) in a batch. Uses projection including distortion models. More... | |
virtual Eigen::Vector2d | createRandomImagePoint () const |
Creates a random (uniform distribution) image point. More... | |
virtual Eigen::Vector3d | createRandomVisiblePoint (double minDist=0.0, double maxDist=10.0) const |
Creates a random visible point in Euclidean coordinates. More... | |
virtual Eigen::Vector4d | createRandomVisibleHomogeneousPoint (double minDist=0.0, double maxDist=10.0) const |
Creates a random visible point in homogeneous coordinates. More... | |
Static Public Member Functions | |
static std::shared_ptr < CameraBase > | createTestObject () |
get a test instance More... | |
static PinholeCamera | testObject () |
get a test instance More... | |
Public Attributes | |
EIGEN_MAKE_ALIGNED_OPERATOR_NEW typedef DISTORTION_T | distortion_t |
Makes the distortion type accessible. More... | |
Static Public Attributes | |
static const int | NumProjectionIntrinsics = 4 |
optimisable projection intrinsics More... | |
static const int | NumIntrinsics |
total number of intrinsics More... | |
Protected Member Functions | |
PinholeCamera ()=delete | |
No default constructor. More... | |
Protected Member Functions inherited from okvis::cameras::CameraBase | |
bool | isMasked (const Eigen::Vector2d &imagePoint) const |
Check if the keypoint is masked. More... | |
bool | isInImage (const Eigen::Vector2d &imagePoint) const |
Check if the keypoint is in the image. More... | |
Protected Attributes | |
distortion_t | distortion_ |
the distortion to be used More... | |
Eigen::Matrix< double, NumIntrinsics, 1 > | intrinsics_ |
summary of all intrinsics parameters More... | |
double | fu_ |
focalLengthU More... | |
double | fv_ |
focalLengthV More... | |
double | cu_ |
imageCenterU More... | |
double | cv_ |
imageCenterV More... | |
double | one_over_fu_ |
1.0 / fu_ More... | |
double | one_over_fv_ |
1.0 / fv_ More... | |
double | fu_over_fv_ |
fu_ / fv_ More... | |
Protected Attributes inherited from okvis::cameras::CameraBase | |
cv::Mat | mask_ |
The mask – empty by default. More... | |
int | imageWidth_ |
image width in pixels More... | |
int | imageHeight_ |
image height in pixels More... | |
uint64_t | id_ |
an Id More... | |
Additional Inherited Members | |
Public Types inherited from okvis::cameras::CameraBase | |
enum | ProjectionStatus { ProjectionStatus::Successful, ProjectionStatus::OutsideImage, ProjectionStatus::Masked, ProjectionStatus::Behind, ProjectionStatus::Invalid } |
okvis::cameras::PinholeCamera< DISTORTION_T >::PinholeCamera | ( | int | imageWidth, |
int | imageHeight, | ||
double | focalLengthU, | ||
double | focalLengthV, | ||
double | imageCenterU, | ||
double | imageCenterV, | ||
const distortion_t & | distortion, | ||
uint64_t | id = -1 |
||
) |
Constructor that will figure out the type of distortion.
[in] | imageWidth | The width in pixels. |
[in] | imageHeight | The height in pixels. |
[in] | focalLengthU | The horizontal focal length in pixels. |
[in] | focalLengthV | The vertical focal length in pixels. |
[in] | imageCenterU | The horizontal centre in pixels. |
[in] | imageCenterV | The vertical centre in pixels. |
[in] | distortion | The distortion object to be used. |
[in] | id | Assign a generic ID, if desired. |
|
inline |
Destructor.
|
protecteddelete |
No default constructor.
|
inlinevirtual |
Back-project a 2d image point into Euclidean space (direction vector).
[in] | imagePoint | The image point. |
[out] | direction | The Euclidean direction vector. |
Implements okvis::cameras::CameraBase.
|
inlinevirtual |
Back-project a 2d image point into Euclidean space (direction vector).
[in] | imagePoint | The image point. |
[out] | direction | The Euclidean direction vector. |
[out] | pointJacobian | Jacobian of the back-projection function w.r.t. the point. |
Implements okvis::cameras::CameraBase.
|
inlinevirtual |
Back-project 2d image points into Euclidean space (direction vectors).
[in] | imagePoints | The image points (one point per column). |
[out] | directions | The Euclidean direction vectors (one point per column). |
[out] | success | Success of each of the back-projection |
Implements okvis::cameras::CameraBase.
|
inlinevirtual |
Back-project a 2d image point into homogeneous point (direction vector).
[in] | imagePoint | The image point. |
[out] | direction | The homogeneous point as direction vector. |
Implements okvis::cameras::CameraBase.
|
inlinevirtual |
Back-project a 2d image point into homogeneous point (direction vector).
[in] | imagePoint | The image point. |
[out] | direction | The homogeneous point as direction vector. |
[out] | pointJacobian | Jacobian of the back-projection function. |
Implements okvis::cameras::CameraBase.
|
inlinevirtual |
Back-project 2d image points into homogeneous points (direction vectors).
[in] | imagePoints | The image points (one point per column). |
[out] | directions | The homogeneous points as direction vectors (one point per column). |
[out] | success | Success of each of the back-projection |
Implements okvis::cameras::CameraBase.
|
inlinestatic |
get a test instance
|
inlinevirtual |
Obtain the projection type.
Implements okvis::cameras::CameraBase.
|
inline |
Get the focal length along the u-dimension.
|
inline |
Get the focal length along the v-dimension.
|
inlinevirtual |
Get the intrinsics as a concatenated vector.
Implements okvis::cameras::CameraBase.
|
inline |
Get the image centre along the u-dimension.
|
inline |
Get the focal image centre along the v-dimension.
|
inlinevirtual |
Get the total number of intrinsics.
Implements okvis::cameras::CameraBase.
|
inlinevirtual |
Projects a Euclidean point to a 2d image point (projection). Uses projection including distortion models.
[in] | point | The point in Euclidean coordinates. |
[out] | imagePoint | The image point. |
Implements okvis::cameras::CameraBase.
|
inlinevirtual |
Projects a Euclidean point to a 2d image point (projection). Uses projection including distortion models.
[in] | point | The point in Euclidean coordinates. |
[out] | imagePoint | The image point. |
[out] | pointJacobian | The Jacobian of the projection function w.r.t. the point.. |
[out] | intrinsicsJacobian | The Jacobian of the projection function w.r.t. the intinsics. |
Implements okvis::cameras::CameraBase.
|
inline |
Projects Euclidean points to 2d image points (projection) in a batch. Uses projection including distortion models.
[in] | points | The points in Euclidean coordinates (one point per column). |
[out] | imagePoints | The image points (one point per column). |
[out] | stati | Get information about the success of the projections. See ProjectionStatus for more information. |
|
inlinevirtual |
Projects a point in homogenous coordinates to a 2d image point (projection). Uses projection including distortion models.
[in] | point | The point in Homogeneous coordinates. |
[out] | imagePoint | The image point. |
Implements okvis::cameras::CameraBase.
|
inlinevirtual |
Projects a point in homogenous coordinates to a 2d image point (projection). Uses projection including distortion models.
[in] | point | The point in Homogeneous coordinates. |
[out] | imagePoint | The image point. |
[out] | pointJacobian | The Jacobian of the projection function w.r.t. the point. |
[out] | intrinsicsJacobian | The Jacobian of the projection function w.r.t. the intrinsics. |
Implements okvis::cameras::CameraBase.
|
inline |
Projects points in homogenous coordinates to 2d image points (projection) in a batch. Uses projection including distortion models.
[in] | points | The points in homogeneous coordinates (one point per column). |
[out] | imagePoints | The image points (one point per column). |
[out] | stati | Get information about the success of the projections. See ProjectionStatus for more information. |
|
inlinevirtual |
Projects a point in homogenous coordinates to a 2d image point (projection). Uses projection including distortion models.
[in] | point | The point in Homogeneous coordinates. |
[in] | parameters | The intrinsics. |
[out] | imagePoint | The image point. |
[out] | pointJacobian | The Jacobian of the projection function w.r.t. the point. |
[out] | intrinsicsJacobian | The Jacobian of the projection function w.r.t. the intrinsics. |
Implements okvis::cameras::CameraBase.
|
inlinevirtual |
Projects a Euclidean point to a 2d image point (projection). Uses projection including distortion models.
[in] | point | The point in Euclidean coordinates. |
[in] | parameters | The intrinsics. |
[out] | imagePoint | The image point. |
[out] | pointJacobian | The Jacobian of the projection function w.r.t. the point.. |
[out] | intrinsicsJacobian | The Jacobian of the projection function w.r.t. the intinsics. |
Implements okvis::cameras::CameraBase.
|
inlinevirtual |
overwrite all intrinsics - use with caution !
[in] | intrinsics | The intrinsics as a concatenated vector. |
Implements okvis::cameras::CameraBase.
|
inlinestatic |
get a test instance
|
inlinevirtual |
Obtain the projection type.
Implements okvis::cameras::CameraBase.
|
protected |
imageCenterU
|
protected |
imageCenterV
|
protected |
the distortion to be used
EIGEN_MAKE_ALIGNED_OPERATOR_NEW typedef DISTORTION_T okvis::cameras::PinholeCamera< DISTORTION_T >::distortion_t |
Makes the distortion type accessible.
|
protected |
focalLengthU
|
protected |
fu_ / fv_
|
protected |
focalLengthV
|
protected |
summary of all intrinsics parameters
|
static |
total number of intrinsics
|
static |
optimisable projection intrinsics
|
protected |
1.0 / fu_
|
protected |
1.0 / fv_