farm-ng-core
|
Concrete camera model class. More...
#include <camera_model.h>
Public Member Functions | |
CameraModel () | |
template<class TTransformModelT > | |
CameraModel (TTransformModelT model) | |
Constructs camera model from frame_name and concrete projection model. More... | |
CameraModel (ImageSize image_size, CameraDistortionType projection_type, Eigen::VectorXd const ¶ms) | |
Constructs camera model from frame_name , image_size , projection_type flag and params vector. More... | |
auto | isEmpty () const -> bool |
Returns true if this camera remains default-initialized with zero image dimensions. More... | |
auto | distortionModelName () const -> std::string_view |
Returns name of the camera distortion model. More... | |
auto | modelVariant () -> CameraDistortionVariant & |
Distortion variant mutator. More... | |
auto | modelVariant () const -> CameraDistortionVariant const & |
Distortion variant accessor. More... | |
auto | distortionType () const -> CameraDistortionType |
Camera transform flag. More... | |
auto | focalLength () const -> Eigen::Vector2d |
void | setFocalLength (Eigen::Vector2d const &focal_length) |
Focal length. More... | |
auto | principalPoint () const -> Eigen::Vector2d |
void | setPrincipalPoint (Eigen::Vector2d const &principal_point) |
Focal length. More... | |
auto | params () const -> Eigen::VectorXd |
Returns params vector by value. More... | |
void | setParams (Eigen::VectorXd const ¶ms) |
Sets params vector. More... | |
auto | distortionParams () const -> Eigen::VectorXd |
Returns distortion parameters vector by value. More... | |
auto | camProj (Eigen::Vector3d const &point_camera) const -> Eigen::Vector2d |
Given a point in 3D space in the camera frame, compute the corresponding pixel coordinates in the image. More... | |
auto | distort (Eigen::Vector2d const &point2_in_camera_lifted) const -> Eigen::Vector2d |
Maps a 2-point in the z=1 plane of the camera to a (distorted) pixel in the image. More... | |
auto | dxDistort (Eigen::Vector2d const &point2_in_camera_lifted) const -> Eigen::Matrix2d |
auto | undistort (Eigen::Vector2d const &pixel_image) const -> Eigen::Vector2d |
Maps a pixel in the image to a 2-point in the z=1 plane of the camera. More... | |
auto | undistortTable () const -> MutImage< Eigen::Vector2f > |
auto | dxCamProjX (Eigen::Vector3d const &point_in_camera) const -> Eigen::Matrix< double, 2, 3 > |
Derivative of camProj(x) with respect to x=0. More... | |
auto | dxCamProjExpXPointAt0 (Eigen::Vector3d const &point_in_camera) const -> Eigen::Matrix< double, 2, 6 > |
Derivative of camProj(exp(x) * point) with respect to x=0. More... | |
auto | camUnproj (Eigen::Vector2d const &pixel_image, double depth_z) const -> Eigen::Vector3d |
Given pixel coordinates in the distorted image, and a corresponding depth, reproject to a 3d point in the camera's reference frame. More... | |
auto | subsampleDown () const -> CameraModel |
Subsamples pixel down, factor of 0.5. More... | |
auto | subsampleUp () const -> CameraModel |
Subsamples pixel up, factor of 2.0. More... | |
auto | binDown () const -> CameraModel |
Bins pixel down, factor of 0.5. More... | |
auto | binUp () const -> CameraModel |
Bins pixel up, factor of 2.0. More... | |
auto | imageSize () const -> ImageSize const & |
Image size accessor. More... | |
auto | roi (Eigen::Vector2i const &top_left, ImageSize roi_size) const -> CameraModel |
Region of interest given top_left and `roi_size . More... | |
auto | contains (Eigen::Vector2i const &obs, int border=0) const -> bool |
Returns true if obs is within image. More... | |
auto | contains (Eigen::Vector2d const &obs, double border=0) const -> bool |
Returns true if obs is within image. More... | |
auto | scale (ImageSize image_size) const -> CameraModel |
Static Public Member Functions | |
static auto | createDefaultPinholeModel (ImageSize image_size) -> CameraModel |
Creates default pinhole model from image_size . More... | |
Concrete camera model class.
|
inline |
|
inline |
Constructs camera model from frame_name
and concrete projection model.
sophus::CameraModel::CameraModel | ( | ImageSize | image_size, |
CameraDistortionType | projection_type, | ||
Eigen::VectorXd const & | params | ||
) |
Constructs camera model from frame_name
, image_size
, projection_type
flag and params
vector.
Precondition: params.size()
must match the number of parameters of the specified projection_type
(TransformModel::kNumParams).
auto sophus::CameraModel::binDown | ( | ) | const -> CameraModel |
Bins pixel down, factor of 0.5.
See for details: https://docs.google.com/document/d/1xmhCMWklP2UoQMGaMqFnsoPWoeMvBfXN7S8-ie9k0UA/edit#heading=h.elfm6123mecj
If the original width [height] is odd, the new width [height] will be: (width+1)/2 [height+1)/2].
auto sophus::CameraModel::binUp | ( | ) | const -> CameraModel |
Bins pixel up, factor of 2.0.
See for details: https://docs.google.com/document/d/1xmhCMWklP2UoQMGaMqFnsoPWoeMvBfXN7S8-ie9k0UA/edit#heading=h.elfm6123mecj
auto sophus::CameraModel::camProj | ( | Eigen::Vector3d const & | point_camera | ) | const -> Eigen::Vector2d |
Given a point in 3D space in the camera frame, compute the corresponding pixel coordinates in the image.
auto sophus::CameraModel::camUnproj | ( | Eigen::Vector2d const & | pixel_image, |
double | depth_z | ||
) | const -> Eigen::Vector3d |
Given pixel coordinates in the distorted image, and a corresponding depth, reproject to a 3d point in the camera's reference frame.
auto sophus::CameraModel::contains | ( | Eigen::Vector2d const & | obs, |
double | border = 0 |
||
) | const -> bool |
Returns true if obs is within image.
Positive border makes the image frame smaller.
auto sophus::CameraModel::contains | ( | Eigen::Vector2i const & | obs, |
int | border = 0 |
||
) | const -> bool |
Returns true if obs is within image.
Note: Positive border makes the image frame smaller.
|
static |
Creates default pinhole model from image_size
.
auto sophus::CameraModel::distort | ( | Eigen::Vector2d const & | point2_in_camera_lifted | ) | const -> Eigen::Vector2d |
Maps a 2-point in the z=1 plane of the camera to a (distorted) pixel in the image.
auto sophus::CameraModel::distortionModelName | ( | ) | const -> std::string_view |
Returns name of the camera distortion model.
auto sophus::CameraModel::distortionParams | ( | ) | const -> Eigen::VectorXd |
Returns distortion parameters vector by value.
auto sophus::CameraModel::distortionType | ( | ) | const -> CameraDistortionType |
Camera transform flag.
auto sophus::CameraModel::dxCamProjExpXPointAt0 | ( | Eigen::Vector3d const & | point_in_camera | ) | const -> Eigen::Matrix<double, 2, 6> |
Derivative of camProj(exp(x) * point) with respect to x=0.
auto sophus::CameraModel::dxCamProjX | ( | Eigen::Vector3d const & | point_in_camera | ) | const -> Eigen::Matrix<double, 2, 3> |
Derivative of camProj(x) with respect to x=0.
auto sophus::CameraModel::dxDistort | ( | Eigen::Vector2d const & | point2_in_camera_lifted | ) | const -> Eigen::Matrix2d |
auto sophus::CameraModel::focalLength | ( | ) | const -> Eigen::Vector2d |
|
inline |
Returns true if this camera remains default-initialized with zero image dimensions.
|
inline |
Distortion variant mutator.
|
inline |
Distortion variant accessor.
auto sophus::CameraModel::params | ( | ) | const -> Eigen::VectorXd |
Returns params
vector by value.
auto sophus::CameraModel::principalPoint | ( | ) | const -> Eigen::Vector2d |
auto sophus::CameraModel::roi | ( | Eigen::Vector2i const & | top_left, |
ImageSize | roi_size | ||
) | const -> CameraModel |
Region of interest given top_left
and `roi_size
.
auto sophus::CameraModel::scale | ( | ImageSize | image_size | ) | const -> CameraModel |
void sophus::CameraModel::setFocalLength | ( | Eigen::Vector2d const & | focal_length | ) |
Focal length.
void sophus::CameraModel::setParams | ( | Eigen::VectorXd const & | params | ) |
Sets params
vector.
Precontion: params.size()
must match the number of parameters of the specified projection_type
(TransformModel::kNumParams).
void sophus::CameraModel::setPrincipalPoint | ( | Eigen::Vector2d const & | principal_point | ) |
Focal length.
auto sophus::CameraModel::subsampleDown | ( | ) | const -> CameraModel |
Subsamples pixel down, factor of 0.5.
See for details: https://docs.google.com/document/d/1xmhCMWklP2UoQMGaMqFnsoPWoeMvBfXN7S8-ie9k0UA/edit#heading=h.97r8rr8owwpc
If the original width [height] is odd, the new width [height] will be: (width+1)/2 [height+1)/2].
auto sophus::CameraModel::subsampleUp | ( | ) | const -> CameraModel |
Subsamples pixel up, factor of 2.0.
auto sophus::CameraModel::undistort | ( | Eigen::Vector2d const & | pixel_image | ) | const -> Eigen::Vector2d |
Maps a pixel in the image to a 2-point in the z=1 plane of the camera.
auto sophus::CameraModel::undistortTable | ( | ) | const -> MutImage<Eigen::Vector2f> |