OKVIS ROS
|
Base class for all camera models. More...
#include <CameraBase.hpp>
Public Types | |
enum | ProjectionStatus { ProjectionStatus::Successful, ProjectionStatus::OutsideImage, ProjectionStatus::Masked, ProjectionStatus::Behind, ProjectionStatus::Invalid } |
Public Member Functions | |
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... | |
virtual void | getIntrinsics (Eigen::VectorXd &intrinsics) const =0 |
obtain all intrinsics More... | |
virtual bool | setIntrinsics (const Eigen::VectorXd &intrinsics)=0 |
overwrite all intrinsics - use with caution ! More... | |
virtual int | noIntrinsicsParameters () const =0 |
Obtain the number of intrinsics parameters. More... | |
virtual std::string | type () const =0 |
Obtain the type. More... | |
virtual const std::string | distortionType () const =0 |
Obtain the projection type. More... | |
Methods related to masking a certain image area as invalid. | |
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... | |
Methods related Ids of this camera. | |
void | setId (uint64_t id) |
Set an Id. More... | |
uint64_t | id () const |
Obtain the Id. More... | |
Methods to project points | |
virtual ProjectionStatus | project (const Eigen::Vector3d &point, Eigen::Vector2d *imagePoint) const =0 |
Projects a Euclidean point to a 2d image point (projection). Uses projection including distortion models. More... | |
virtual ProjectionStatus | project (const Eigen::Vector3d &point, Eigen::Vector2d *imagePoint, Eigen::Matrix< double, 2, 3 > *pointJacobian, Eigen::Matrix2Xd *intrinsicsJacobian=NULL) const =0 |
Projects a Euclidean point to a 2d image point (projection). Uses projection including distortion models. More... | |
virtual ProjectionStatus | projectWithExternalParameters (const Eigen::Vector3d &point, const Eigen::VectorXd ¶meters, Eigen::Vector2d *imagePoint, Eigen::Matrix< double, 2, 3 > *pointJacobian=NULL, Eigen::Matrix2Xd *intrinsicsJacobian=NULL) const =0 |
Projects a Euclidean point to a 2d image point (projection). Uses projection including distortion models. 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 ProjectionStatus | projectHomogeneous (const Eigen::Vector4d &point, Eigen::Vector2d *imagePoint) const =0 |
Projects a point in homogenous coordinates to a 2d image point (projection). Uses projection including distortion models. More... | |
virtual ProjectionStatus | projectHomogeneous (const Eigen::Vector4d &point, Eigen::Vector2d *imagePoint, Eigen::Matrix< double, 2, 4 > *pointJacobian, Eigen::Matrix2Xd *intrinsicsJacobian=NULL) const =0 |
Projects a point in homogenous coordinates to a 2d image point (projection). Uses projection including distortion models. More... | |
virtual 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 =0 |
Projects a point in homogenous coordinates to a 2d image point (projection). 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... | |
Methods to backproject points | |
virtual bool | backProject (const Eigen::Vector2d &imagePoint, Eigen::Vector3d *direction) const =0 |
Back-project a 2d image point into Euclidean space (direction vector). More... | |
virtual bool | backProject (const Eigen::Vector2d &imagePoint, Eigen::Vector3d *direction, Eigen::Matrix< double, 3, 2 > *pointJacobian) const =0 |
Back-project a 2d image point into Euclidean space (direction vector). More... | |
virtual bool | backProjectBatch (const Eigen::Matrix2Xd &imagePoints, Eigen::Matrix3Xd *directions, std::vector< bool > *success) const =0 |
Back-project 2d image points into Euclidean space (direction vectors). More... | |
virtual bool | backProjectHomogeneous (const Eigen::Vector2d &imagePoint, Eigen::Vector4d *direction) const =0 |
Back-project a 2d image point into homogeneous point (direction vector). More... | |
virtual bool | backProjectHomogeneous (const Eigen::Vector2d &imagePoint, Eigen::Vector4d *direction, Eigen::Matrix< double, 4, 2 > *pointJacobian) const =0 |
Back-project a 2d image point into homogeneous point (direction vector). More... | |
virtual bool | backProjectHomogeneousBatch (const Eigen::Matrix2Xd &imagePoints, Eigen::Matrix4Xd *directions, std::vector< bool > *success) const =0 |
Back-project 2d image points into homogeneous points (direction vectors). More... | |
Methods to facilitate unit testing | |
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... | |
Protected Member Functions | |
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 | |
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... | |
Base class for all camera models.
|
strong |
|
inline |
default Constructor – does nothing serious
|
inline |
Constructor for width, height and Id.
|
inlinevirtual |
Destructor – does nothing.
|
pure virtual |
Back-project a 2d image point into Euclidean space (direction vector).
[in] | imagePoint | The image point. |
[out] | direction | The Euclidean direction vector. |
Implemented in okvis::cameras::PinholeCamera< DISTORTION_T >.
|
pure virtual |
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. |
Implemented in okvis::cameras::PinholeCamera< DISTORTION_T >.
|
pure virtual |
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 |
Implemented in okvis::cameras::PinholeCamera< DISTORTION_T >.
|
pure virtual |
Back-project a 2d image point into homogeneous point (direction vector).
[in] | imagePoint | The image point. |
[out] | direction | The homogeneous point as direction vector. |
Implemented in okvis::cameras::PinholeCamera< DISTORTION_T >.
|
pure virtual |
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. |
Implemented in okvis::cameras::PinholeCamera< DISTORTION_T >.
|
pure virtual |
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 |
Implemented in okvis::cameras::PinholeCamera< DISTORTION_T >.
|
virtual |
Creates a random (uniform distribution) image point.
|
virtual |
Creates a random visible point in homogeneous coordinates.
[in] | minDist | The minimal distance of this point. |
[in] | maxDist | The maximum distance of this point. |
|
virtual |
Creates a random visible point in Euclidean coordinates.
[in] | minDist | The minimal distance of this point. |
[in] | maxDist | The maximum distance of this point. |
|
pure virtual |
Obtain the projection type.
Implemented in okvis::cameras::PinholeCamera< DISTORTION_T >.
|
pure virtual |
obtain all intrinsics
Implemented in okvis::cameras::PinholeCamera< DISTORTION_T >.
|
inline |
Was a nonzero mask set?
|
inline |
Obtain the Id.
|
inline |
The height of the image in pixels.
|
inline |
The width of the image in pixels.
|
inlineprotected |
Check if the keypoint is in the image.
|
inlineprotected |
Check if the keypoint is masked.
|
inline |
Get the mask.
|
pure virtual |
Obtain the number of intrinsics parameters.
Implemented in okvis::cameras::PinholeCamera< DISTORTION_T >.
|
pure virtual |
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. |
Implemented in okvis::cameras::PinholeCamera< DISTORTION_T >.
|
pure virtual |
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. |
Implemented in okvis::cameras::PinholeCamera< DISTORTION_T >.
|
pure virtual |
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. |
|
pure virtual |
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. |
Implemented in okvis::cameras::PinholeCamera< DISTORTION_T >.
|
pure virtual |
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. |
Implemented in okvis::cameras::PinholeCamera< DISTORTION_T >.
|
pure virtual |
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. |
|
pure virtual |
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. |
Implemented in okvis::cameras::PinholeCamera< DISTORTION_T >.
|
pure virtual |
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. |
Implemented in okvis::cameras::PinholeCamera< DISTORTION_T >.
|
inline |
stop masking
Was a nonzero mask set?
|
inline |
Set an Id.
|
pure virtual |
overwrite all intrinsics - use with caution !
Implemented in okvis::cameras::PinholeCamera< DISTORTION_T >.
|
inline |
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.
[in] | mask | The actual mask. |
|
pure virtual |
Obtain the type.
Implemented in okvis::cameras::PinholeCamera< DISTORTION_T >.
|
protected |
an Id
|
protected |
image height in pixels
|
protected |
image width in pixels
|
protected |
The mask – empty by default.