Class Camera3DLidar¶
Defined in File camera-3d-lidar.h
Inheritance Relationships¶
Base Type¶
public aslam::Cloneable< Camera, Camera3DLidar >
(Template Class Cloneable)
Class Documentation¶
-
class
aslam
::
Camera3DLidar
: public aslam::Cloneable<Camera, Camera3DLidar>¶ An implementation of a projection model for a 360 degree 3D lidar.
Constructors/destructors and operators
-
friend friend std::ostream & operator<< (std::ostream &out, const Camera3DLidar &camera)
Convenience function to print the state using streams.
-
Camera3DLidar
()¶ Empty constructor for serialization interface.
-
Camera3DLidar
(const Camera3DLidar &other) = default¶ Copy constructor for clone operation.
-
void
operator=
(const Camera3DLidar&) = delete¶
-
Camera3DLidar
(const Eigen::VectorXd &intrinsics, const uint32_t image_width, const uint32_t image_height)¶ Construct a Camera3DLidar.
- Parameters
[in] intrinsics
: (Horizontal-, vertical- resolution in radians, frequency in Hz).[in] image_width
: Image width in pixels.[in] image_height
: Image height in pixels.
-
inline virtual
~Camera3DLidar
()¶
Methods to project and back-project euclidean points
-
virtual bool
backProject3
(const Eigen::Ref<const Eigen::Vector2d> &keypoint, Eigen::Vector3d *out_point_3d) const¶ Compute the 3d bearing vector in euclidean coordinates given a keypoint in image coordinates.
Uses the projection (& distortion) models. The result might be in normalized image plane for some camera implementations but not for the general case.
- Parameters
[in] keypoint
: Keypoint in image coordinates.[out] out_point_3d
: Bearing vector in euclidean coordinates
-
template<typename
DerivedKeyPoint
, typenameDerivedPoint3d
>
inline const ProjectionResultevaluateProjectionResult
(const Eigen::MatrixBase<DerivedKeyPoint> &keypoint, const Eigen::MatrixBase<DerivedPoint3d> &point_3d) const¶ Checks the success of a projection operation and returns the result in a ProjectionResult object.
- Return
The ProjectionResult object contains details about the success of the projection.
- Parameters
[in] keypoint
: Keypoint in image coordinates.[in] point_3d
: Projected point in euclidean.
Functional methods to project and back-project points
-
template<typename
ScalarType
, typenameDistortionType
, typenameMIntrinsics
, typenameMDistortion
>
const ProjectionResultproject3Functional
(const Eigen::Matrix<ScalarType, 3, 1> &point_3d, const Eigen::MatrixBase<MIntrinsics> &intrinsics_external, const Eigen::MatrixBase<MDistortion> &distortion_coefficients_external, Eigen::Matrix<ScalarType, 2, 1> *out_keypoint) const¶ Template version of project3Functional.
-
virtual const ProjectionResult
project3Functional
(const Eigen::Ref<const Eigen::Vector3d> &point_3d, const Eigen::VectorXd *intrinsics_external, const Eigen::VectorXd *distortion_coefficients_external, Eigen::Vector2d *out_keypoint, Eigen::Matrix<double, 2, 3> *out_jacobian_point, Eigen::Matrix<double, 2, Eigen::Dynamic> *out_jacobian_intrinsics, Eigen::Matrix<double, 2, Eigen::Dynamic> *out_jacobian_distortion) const¶ This function projects a point into the image using the intrinsic parameters that are passed in as arguments.
If any of the Jacobians are nonnull, they should be filled in with the Jacobian with respect to small changes in the argument.
- Return
Contains information about the success of the projection. Check ProjectionResult for more information.
- Parameters
[in] point_3d
: The point in euclidean coordinates.[in] intrinsics_external
: External intrinsic parameter vector. NOTE: If nullptr, use internal distortion parameters.[in] distortion_coefficients_external
: External distortion parameter vector. Parameter is ignored is no distortion is active. NOTE: If nullptr, use internal distortion parameters. NOTE: THIS IS NOT USABLE FOR THIS CAMERA![out] out_keypoint
: The keypoint in image coordinates. NOTE: THIS IS NOT USABLE FOR THIS CAMERA![out] out_jacobian_point
: The Jacobian wrt. to changes in the euclidean point. nullptr: calculation is skipped. NOTE: THIS IS NOT USABLE FOR THIS CAMERA![out] out_jacobian_intrinsics
: The Jacobian wrt. to changes in the intrinsics. nullptr: calculation is skipped. NOTE: THIS IS NOT USABLE FOR THIS CAMERA![out] out_jacobian_distortion
: The Jacobian wrt. to changes in the distortion parameters. nullptr: calculation is skipped. NOTE: THIS IS NOT USABLE FOR THIS CAMERA!
Methods to support unit testing.
-
virtual Eigen::Vector2d
createRandomKeypoint
() const¶ Creates a random valid keypoint..
-
virtual Eigen::Vector3d
createRandomVisiblePoint
(double depth) const¶ Creates a random visible point.
Negative depth means random between 0 and 100 meters.
-
void
getBorderRays
(Eigen::MatrixXd &rays) const¶ Get a set of border rays.
Methods to access intrinsics.
-
inline double
verticalResolution
() const¶ The vertical resolution of the lidar in radians.
-
inline double
horizontalResolution
() const¶ The horizontal resolution of the lidar in radians.
-
inline double
horizontalCenter
() const¶ The horizontal center of the image.
-
inline double
verticalCenter
() const¶ The vertical center of the image.
-
inline virtual int
getParameterSize
() const¶ Returns the number of intrinsic parameters used in this camera model.
-
virtual bool
intrinsicsValid
(const Eigen::VectorXd &intrinsics) const¶ Function to check whether the given intrinsic parameters are valid for this model.
-
virtual void
printParameters
(std::ostream &out, const std::string &text) const¶ Print the internal parameters of the camera in a human-readable form Print to the ostream that is passed in.
The text is extra text used by the calling function to distinguish cameras
-
static inline constexpr int
parameterCount
()¶ Returns the number of intrinsic parameters used in this camera model.
-
static bool
areParametersValid
(const Eigen::VectorXd ¶meters)¶ Static function that checks whether the given intrinsic parameters are valid for this model.
Public Types
Public Functions
-
ASLAM_POINTER_TYPEDEFS
(Camera3DLidar)¶
-
inline virtual int64_t
rollingShutterDelayNanoSeconds
(const Eigen::Vector2d &keypoint) const¶ The amount of time elapsed between the first row of the image and the keypoint.
For a global shutter camera, this can return Duration(0).
- Return
Time elapsed between the first row of the image and the keypoint in nanoseconds.
- Parameters
[in] keypoint
: Keypoint to which the delay should be calculated.
-
inline int64_t
rollingShutterDelayNanoSeconds
() const¶ The amount of time elapsed between the first row of the image and the last row of the image.
For a global shutter camera, this can return 0.
-
inline virtual uint32_t
getNumberOfLines
() const¶ returns the number of lines, this is either the number of columns or rows or 1 in case of a global shutter camera.
-
inline virtual LineDelayMode
getLineDelayMode
() const¶ Returns which orientation the rolling shutter effect is occuring.
Public Static Functions
-
template<typename
DistortionType
= NullDistortion>
static inline Camera3DLidar::PtrcreateTestCamera
()¶ Create a test camera object for unit testing.
-
template<typename
DistortionType
= NullDistortion>
static inline Camera3DLidar::UniquePtrcreateTestCameraUnique
()¶ Create a test camera object for unit testing.
-