farm-ng-core
|
Camera model class template for pinhole-like camera projections. More...
#include <camera_model.h>
Public Types | |
using | Distortion = TDistortion |
using | Proj = TProj |
using | PointCamera = Eigen::Matrix< TScalar, 3, 1 > |
using | PixelImage = Eigen::Matrix< TScalar, 2, 1 > |
using | ProjInCameraLifted = Eigen::Matrix< TScalar, 2, 1 > |
using | Params = Eigen::Matrix< TScalar, kNumParams, 1 > |
using | DistorationParams = Eigen::Matrix< TScalar, kNumDistortionParams, 1 > |
Public Member Functions | |
CameraModelT (ImageSize const &image_size, Params const ¶ms) | |
Constructs camera model from image size and set up parameters. More... | |
CameraModelT () | |
auto | focalLength () const -> PixelImage |
Focal length. More... | |
void | setFocalLength (PixelImage const &focal_length) |
Focal length. More... | |
auto | principalPoint () const -> PixelImage |
void | setPrincipalPoint (PixelImage const &principal_point) |
Focal length. More... | |
auto | distortionParams () const -> DistorationParams |
Returns distortion parameters by value. More... | |
auto | params () -> Eigen::Matrix< TScalar, kNumParams, 1 > & |
Parameters mutator. More... | |
auto | params () const -> Eigen::Matrix< TScalar, kNumParams, 1 > const & |
Parameters accessor. More... | |
auto | subsampleDown () const -> CameraModelT |
Subsamples pixel down, factor of 0.5. More... | |
auto | subsampleUp () const -> CameraModelT |
Subsamples pixel up, factor of 2.0. More... | |
auto | binDown () const -> CameraModelT |
Bins pixel down, factor of 0.5. More... | |
auto | binUp () const -> CameraModelT |
Bins pixel up, factor of 2.0. More... | |
auto | scale (ImageSize const &image_size) const -> CameraModelT |
auto | roi (Eigen::Vector2i const &top_left, ImageSize roi_size) const -> CameraModelT |
Region of interest given top_left and `roi_size . More... | |
auto | distort (ProjInCameraLifted const &point2_in_camera_lifted) const -> PixelImage |
Maps a 2-point in the z=1 plane of the camera to a pixel in the image. More... | |
auto | dxDistort (PixelImage const &pixel_in_image) const -> Eigen::Matrix< TScalar, 2, 2 > |
auto | undistort (PixelImage const &pixel_in_image) const -> ProjInCameraLifted |
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 | camProj (PointCamera const &point_in_camera) const -> PixelImage |
Projects 3-point in camera frame to a pixel in the image. More... | |
auto | dxCamProjX (PointCamera const &point_in_camera) const -> Eigen::Matrix< TScalar, 2, 3 > |
auto | camUnproj (PixelImage const &pixel_in_image, double depth_z) const -> PointCamera |
Unprojects pixel in the image to point in camera frame. More... | |
auto | data () -> TScalar * |
Raw data access. To be used in ceres optimization only. More... | |
auto | imageSize () const -> ImageSize const & |
Accessor of image size. More... | |
auto | contains (Eigen::Vector2i const &obs, int border=0) const -> bool |
Returns true if obs is within image. More... | |
auto | contains (PixelImage const &obs, TScalar border=TScalar(0)) const -> bool |
Returns true if obs is within image. More... | |
template<typename TScalar2 > | |
auto | cast () const -> CameraModelT< TScalar2, TDistortion, TProj > |
cast to different scalar type. More... | |
Static Public Member Functions | |
static auto | fromData (TScalar const *const ptr) -> CameraModelT |
Returns camera model from raw data pointer. To be used within ceres optimization only. More... | |
Static Public Attributes | |
static constexpr int | kNumDistortionParams = Distortion::kNumDistortionParams |
static constexpr int | kNumParams = Distortion::kNumParams |
static constexpr const std::string_view | kProjectionModel |
Camera model class template for pinhole-like camera projections.
using sophus::CameraModelT< TScalar, TDistortion, TProj >::DistorationParams = Eigen::Matrix<TScalar, kNumDistortionParams, 1> |
using sophus::CameraModelT< TScalar, TDistortion, TProj >::Distortion = TDistortion |
using sophus::CameraModelT< TScalar, TDistortion, TProj >::Params = Eigen::Matrix<TScalar, kNumParams, 1> |
using sophus::CameraModelT< TScalar, TDistortion, TProj >::PixelImage = Eigen::Matrix<TScalar, 2, 1> |
using sophus::CameraModelT< TScalar, TDistortion, TProj >::PointCamera = Eigen::Matrix<TScalar, 3, 1> |
using sophus::CameraModelT< TScalar, TDistortion, TProj >::Proj = TProj |
using sophus::CameraModelT< TScalar, TDistortion, TProj >::ProjInCameraLifted = Eigen::Matrix<TScalar, 2, 1> |
|
inline |
Constructs camera model from image size and set up parameters.
|
inline |
|
inline |
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].
|
inline |
Bins pixel up, factor of 2.0.
See for details: https://docs.google.com/document/d/1xmhCMWklP2UoQMGaMqFnsoPWoeMvBfXN7S8-ie9k0UA/edit#heading=h.elfm6123mecj
|
inline |
Projects 3-point in camera frame to a pixel in the image.
|
inline |
Unprojects pixel in the image to point in camera frame.
The point is projected onto the xy-plane at z = depth_z
.
|
inline |
cast to different scalar type.
|
inline |
Returns true if obs is within image.
Note: Positive border makes the image frame smaller.
|
inline |
Returns true if obs is within image.
Note: Positive border makes the image frame smaller.
|
inline |
Raw data access. To be used in ceres optimization only.
|
inline |
Maps a 2-point in the z=1 plane of the camera to a pixel in the image.
|
inline |
Returns distortion parameters by value.
|
inline |
|
inline |
|
inline |
Focal length.
|
inlinestatic |
Returns camera model from raw data pointer. To be used within ceres optimization only.
|
inline |
Accessor of image size.
|
inline |
Parameters mutator.
|
inline |
Parameters accessor.
|
inline |
|
inline |
Region of interest given top_left
and `roi_size
.
|
inline |
|
inline |
Focal length.
|
inline |
Focal length.
|
inline |
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].
|
inline |
Subsamples pixel up, factor of 2.0.
See for details: https://docs.google.com/document/d/1xmhCMWklP2UoQMGaMqFnsoPWoeMvBfXN7S8-ie9k0UA/edit#heading=h.97r8rr8owwpc
|
inline |
Maps a pixel in the image to a 2-point in the z=1 plane of the camera.
|
inline |
|
staticconstexpr |
|
staticconstexpr |
|
staticconstexpr |