![]() |
AliceVision
Photogrammetric Computer Vision Framework
|
Basis class for all intrinsic parameters of a camera. More...
#include <IntrinsicBase.hpp>
Public Types | |
| using | sptr = std::shared_ptr< IntrinsicBase > |
| using | ptr = IntrinsicBase * |
Public Member Functions | |
| IntrinsicBase (unsigned int width, unsigned int height, const std::string &serialNumber="") | |
| bool | isLocked () const |
| Get the lock state of the intrinsic. More... | |
| unsigned int | w () const |
| Get the intrinsic image width. More... | |
| unsigned int | h () const |
| Get the intrinsic image height. More... | |
| double | sensorWidth () const |
| Get the intrinsic sensor width. More... | |
| double | sensorHeight () const |
| Get the intrinsic sensor height. More... | |
| const std::string & | serialNumber () const |
| Get the intrinsic serial number. More... | |
| EInitMode | getInitializationMode () const |
| Get the intrinsic initialization mode. More... | |
| virtual bool | operator== (const IntrinsicBase &other) const |
| operator == More... | |
| bool | operator!= (const IntrinsicBase &other) const |
| Vec2 | transformProject (const geometry::Pose3 &pose, const Vec4 &pt3D, bool applyDistortion=true) const |
| Projection of a 3D point into the camera plane (Apply pose, disto (if any) and Intrinsics) More... | |
| virtual Vec2 | transformProject (const Eigen::Matrix4d &pose, const Vec4 &pt3D, bool applyDistortion=true) const =0 |
| Projection of a 3D point into the camera plane (Apply pose, disto (if any) and Intrinsics) More... | |
| virtual Vec2 | project (const Vec4 &pt3D, bool applyDistortion=true) const =0 |
| Projection of a 3D point into the camera plane (Apply disto (if any) and Intrinsics) More... | |
| Vec3 | backprojectTransform (const Vec2 &pt2D, bool applyUndistortion=true, const geometry::Pose3 &pose=geometry::Pose3(), double depth=1.0) const |
| Back-projection of a 2D point at a specific depth into a 3D point. More... | |
| Vec3 | backProjectUnit (const Vec2 &pt2D) const |
| Back-projection of a 2D point on a unitsphere. More... | |
| Vec4 | getCartesianfromSphericalCoordinates (const Vec3 &pt) |
| Eigen::Matrix< double, 4, 3 > | getDerivativeCartesianfromSphericalCoordinates (const Vec3 &pt) |
| virtual Eigen::Matrix< double, 2, 3 > | getDerivativeTransformProjectWrtPoint3 (const Eigen::Matrix4d &pose, const Vec4 &pt3D) const =0 |
| Get the derivative of a projection of a 3D point into the camera plane. More... | |
| virtual Eigen::Matrix< double, 2, Eigen::Dynamic > | getDerivativeTransformProjectWrtParams (const Eigen::Matrix4d &pos, const Vec4 &pt3D) const =0 |
| Get the derivative of a projection of a 3D point into the camera plane. More... | |
| virtual Eigen::Matrix< double, 3, Eigen::Dynamic > | getDerivativeBackProjectUnitWrtParams (const Vec2 &pt2D) const =0 |
| Get the derivative of the unit sphere backprojection. More... | |
| Vec2 | residual (const geometry::Pose3 &pose, const Vec4 &X, const Vec2 &x, bool applyDistortion=true) const |
| Compute the residual between the 3D projected point X and an image observation x. More... | |
| Mat2X | residuals (const geometry::Pose3 &pose, const Mat3X &X, const Mat2X &x) const |
| Compute the residuals between the 3D projected point X and an image observation x. More... | |
| void | lock () |
| Lock the intrinsic. | |
| void | unlock () |
| Unlock the intrinsic. | |
| void | setWidth (unsigned int width) |
| Set the intrinsic image width. More... | |
| void | setHeight (unsigned int height) |
| Set the intrinsic image height. More... | |
| void | setSensorWidth (double width) |
| Set the intrinsic sensor width. More... | |
| void | setSensorHeight (double height) |
| Set the intrinsic sensor height. More... | |
| void | setSerialNumber (const std::string &serialNumber) |
| Set the serial number. More... | |
| void | setInitializationMode (EInitMode initializationMode) |
| Set the intrinsic initialization mode. More... | |
| virtual IntrinsicBase * | clone () const =0 |
| Polymorphic clone. | |
| virtual void | assign (const IntrinsicBase &other)=0 |
| Assign object. More... | |
| virtual EINTRINSIC | getType () const =0 |
| Get embed camera type. More... | |
| std::string | getTypeStr () const |
| Get the string describing the intrinsic type. More... | |
| virtual std::vector< double > | getParameters () const =0 |
| Get the intrinsic parameters. More... | |
| virtual std::size_t | getParametersSize () const =0 |
| Get the count of intrinsic parameters. More... | |
| virtual bool | updateFromParams (const std::vector< double > ¶ms)=0 |
| Update intrinsic parameters. More... | |
| virtual bool | importFromParams (const std::vector< double > ¶ms, const Version &inputVersion)=0 |
| Import intrinsic parameters from external array. More... | |
| virtual Vec2 | cam2ima (const Vec2 &p) const =0 |
| Transform a point from the camera plane to the image plane. More... | |
| virtual Vec2 | ima2cam (const Vec2 &p) const =0 |
| Transform a point from the image plane to the camera plane. More... | |
| virtual bool | hasDistortion () const |
| Camera model handles a distortion field. More... | |
| virtual Vec2 | addDistortion (const Vec2 &p) const =0 |
| Add the distortion field to a point (that is in normalized camera frame) More... | |
| virtual Vec2 | removeDistortion (const Vec2 &p) const =0 |
| Remove the distortion to a camera point (that is in normalized camera frame) More... | |
| virtual Vec2 | getUndistortedPixel (const Vec2 &p) const =0 |
| Return the undistorted pixel (with removed distortion) More... | |
| virtual Vec2 | getDistortedPixel (const Vec2 &p) const =0 |
| Return the distorted pixel (with added distortion) More... | |
| virtual void | setDistortionInitializationMode (EInitMode distortionInitializationMode)=0 |
| Set The intrinsic disto initialization mode. More... | |
| virtual EInitMode | getDistortionInitializationMode () const =0 |
| Get the intrinsic disto initialization mode. More... | |
| virtual double | imagePlaneToCameraPlaneError (double value) const =0 |
| Normalize a given unit pixel error to the camera plane. More... | |
| virtual double | pixelProbability () const =0 |
| What is the probability of a pixel wrt the whole fov. More... | |
| virtual bool | isValid () const |
| Return true if the intrinsic is valid. More... | |
| virtual bool | isVisibleRay (const Vec3 &ray) const =0 |
| Return true if this ray should be visible in the image. More... | |
| virtual bool | isVisible (const Vec2 &pix) const |
| Return true if these pixel coordinates should be visible in the image. More... | |
| virtual bool | isVisible (const Vec2f &pix) const |
| Return true if these pixel coordinates should be visible in the image. More... | |
| virtual float | getMaximalDistortion (double minRadius, double maxRadius) const |
| Assuming the distortion is a function of radius, estimate the maximal undistorted radius for a range of distorted radius. More... | |
| virtual std::size_t | hashValue () const |
| Generate an unique Hash from the camera parameters (used for grouping) More... | |
| virtual void | rescale (float factorW, float factorH) |
| Rescale intrinsics to reflect a rescale of the camera image. More... | |
| virtual Vec3 | toUnitSphere (const Vec2 &pt) const =0 |
| Transform a given point (in pixels) to unit sphere in meters. More... | |
| virtual double | getHorizontalFov () const =0 |
| Get the horizontal FOV in radians. More... | |
| virtual double | getVerticalFov () const =0 |
| Get the vertical FOV in radians. More... | |
| virtual void | initializeState () |
| Initialize state with default values The estimator state is used in the bundle adjustment to decide if we update it. It is set to constant if the intrinsic is locked It is set to refined if unlocked. | |
| EEstimatorParameterState | getState () const |
| accessor to estimator state More... | |
| void | setState (EEstimatorParameterState state) |
| mutator for the estimator state More... | |
Protected Attributes | |
| std::string | _serialNumber |
| double | _sensorWidth = 36.0 |
| double | _sensorHeight = 24.0 |
| unsigned int | _w = 0 |
| unsigned int | _h = 0 |
| EInitMode | _initializationMode = EInitMode::NONE |
| initialization mode | |
| bool | _locked = false |
| intrinsic lock | |
| EEstimatorParameterState | _state = EEstimatorParameterState::REFINED |
Basis class for all intrinsic parameters of a camera.
Store the image size & define all basis optical modelization of a camera
|
pure virtual |
Add the distortion field to a point (that is in normalized camera frame)
| [in] | p | The point |
Implemented in aliceVision::camera::IntrinsicScaleOffsetDisto.
|
pure virtual |
Assign object.
| [in] | other |
Implemented in aliceVision::camera::Equidistant, aliceVision::camera::IntrinsicScaleOffsetDisto, aliceVision::camera::Pinhole, and aliceVision::camera::Equirectangular.
| Vec3 aliceVision::camera::IntrinsicBase::backprojectTransform | ( | const Vec2 & | pt2D, |
| bool | applyUndistortion = true, |
||
| const geometry::Pose3 & | pose = geometry::Pose3(), |
||
| double | depth = 1.0 |
||
| ) | const |
Back-projection of a 2D point at a specific depth into a 3D point.
| [in] | pt2D | The 2D point |
| [in] | applyDistortion | If true, apply the distortion if there is any |
| [in] | pose | The camera pose |
| [in] | depth | The depth |
| Vec3 aliceVision::camera::IntrinsicBase::backProjectUnit | ( | const Vec2 & | pt2D | ) | const |
Back-projection of a 2D point on a unitsphere.
| [in] | pt2D | The 2D point |
|
pure virtual |
Transform a point from the camera plane to the image plane.
| [in] | p | A point from the camera plane |
Implemented in aliceVision::camera::Equidistant, and aliceVision::camera::IntrinsicScaleOffset.
|
pure virtual |
Get the derivative of the unit sphere backprojection.
| [in] | pt2D | The 2D point |
Implemented in aliceVision::camera::Equidistant, aliceVision::camera::Pinhole, and aliceVision::camera::Equirectangular.
|
pure virtual |
Get the derivative of a projection of a 3D point into the camera plane.
| [in] | pose | The pose |
| [in] | pt3D | The 3D point |
Implemented in aliceVision::camera::Equidistant, aliceVision::camera::Pinhole, and aliceVision::camera::Equirectangular.
|
pure virtual |
Get the derivative of a projection of a 3D point into the camera plane.
| [in] | pose | The pose |
| [in] | pt3D | The 3D point |
Implemented in aliceVision::camera::Equidistant, aliceVision::camera::Pinhole, and aliceVision::camera::Equirectangular.
|
pure virtual |
Return the distorted pixel (with added distortion)
| [in] | p | The undistorted point |
Implemented in aliceVision::camera::IntrinsicScaleOffsetDisto.
|
pure virtual |
Get the intrinsic disto initialization mode.
Implemented in aliceVision::camera::IntrinsicScaleOffsetDisto.
|
pure virtual |
Get the horizontal FOV in radians.
Implemented in aliceVision::camera::Equidistant, aliceVision::camera::Pinhole, and aliceVision::camera::Equirectangular.
|
inline |
Get the intrinsic initialization mode.
|
virtual |
Assuming the distortion is a function of radius, estimate the maximal undistorted radius for a range of distorted radius.
| minRadius | the minimal radius to consider |
| maxRadius | the maximal radius to consider |
|
pure virtual |
Get the intrinsic parameters.
Implemented in aliceVision::camera::IntrinsicScaleOffsetDisto.
|
pure virtual |
Get the count of intrinsic parameters.
Implemented in aliceVision::camera::IntrinsicScaleOffsetDisto.
|
inline |
accessor to estimator state
|
pure virtual |
Get embed camera type.
Implemented in aliceVision::camera::Equidistant, aliceVision::camera::Pinhole, and aliceVision::camera::Equirectangular.
|
inline |
Get the string describing the intrinsic type.
|
pure virtual |
Return the undistorted pixel (with removed distortion)
| [in] | p | The point |
Implemented in aliceVision::camera::IntrinsicScaleOffsetDisto.
|
pure virtual |
Get the vertical FOV in radians.
Implemented in aliceVision::camera::Equidistant, aliceVision::camera::Pinhole, and aliceVision::camera::Equirectangular.
|
inline |
Get the intrinsic image height.
|
inlinevirtual |
Camera model handles a distortion field.
Reimplemented in aliceVision::camera::IntrinsicScaleOffsetDisto.
|
virtual |
Generate an unique Hash from the camera parameters (used for grouping)
|
pure virtual |
Transform a point from the image plane to the camera plane.
| [in] | p | A point from the image plane |
Implemented in aliceVision::camera::Equidistant, and aliceVision::camera::IntrinsicScaleOffset.
|
pure virtual |
Normalize a given unit pixel error to the camera plane.
| [in] | value | Given unit pixel error |
Implemented in aliceVision::camera::Equidistant, aliceVision::camera::Pinhole, and aliceVision::camera::Equirectangular.
|
pure virtual |
Import intrinsic parameters from external array.
| [in] | intrinsic | parameters |
| [in] | inputVersion | input source version (for optional transformation) |
Implemented in aliceVision::camera::IntrinsicScaleOffset.
|
inline |
Get the lock state of the intrinsic.
|
inlinevirtual |
Return true if the intrinsic is valid.
Reimplemented in aliceVision::camera::Equidistant, aliceVision::camera::Pinhole, and aliceVision::camera::Equirectangular.
|
virtual |
Return true if these pixel coordinates should be visible in the image.
| pix | input pixel coordinates to check for visibility |
|
virtual |
Return true if these pixel coordinates should be visible in the image.
| pix | input pixel coordinates to check for visibility |
|
pure virtual |
Return true if this ray should be visible in the image.
| ray | input ray to check for visibility |
Implemented in aliceVision::camera::Equidistant, aliceVision::camera::Pinhole, and aliceVision::camera::Equirectangular.
|
virtual |
operator ==
| [in] | other |
Reimplemented in aliceVision::camera::IntrinsicScaleOffsetDisto, and aliceVision::camera::IntrinsicScaleOffset.
|
pure virtual |
What is the probability of a pixel wrt the whole fov.
Implemented in aliceVision::camera::Equidistant, aliceVision::camera::Pinhole, and aliceVision::camera::Equirectangular.
|
pure virtual |
Projection of a 3D point into the camera plane (Apply disto (if any) and Intrinsics)
| [in] | pt3D | The 3D point |
| [in] | applyDistortion | If true, apply the distortion if there is any |
Implemented in aliceVision::camera::Equidistant, aliceVision::camera::Pinhole, and aliceVision::camera::Equirectangular.
|
pure virtual |
Remove the distortion to a camera point (that is in normalized camera frame)
| [in] | p | The point |
Implemented in aliceVision::camera::IntrinsicScaleOffsetDisto.
|
virtual |
Rescale intrinsics to reflect a rescale of the camera image.
| factorW | a scale factor for Width |
| factorH | a scale factor for Height |
Reimplemented in aliceVision::camera::IntrinsicScaleOffset.
|
inline |
Compute the residual between the 3D projected point X and an image observation x.
| [in] | pose | The pose |
| [in] | X | The 3D projected point |
| [in] | x | The image observation |
| [in] | applyDistortion | If true, apply the distortion if there is any |
|
inline |
Compute the residuals between the 3D projected point X and an image observation x.
| [in] | pose | The pose |
| [in] | X | The 3D projection |
| [in] | x | The image observation |
|
inline |
Get the intrinsic sensor height.
|
inline |
Get the intrinsic sensor width.
|
inline |
Get the intrinsic serial number.
|
pure virtual |
Set The intrinsic disto initialization mode.
| [in] | distortionInitializationMode | The intrintrinsic distortion initialization mode enum |
Implemented in aliceVision::camera::IntrinsicScaleOffsetDisto.
|
inline |
Set the intrinsic image height.
| [in] | height | The image height |
|
inline |
Set the intrinsic initialization mode.
| [in] | initializationMode | The intrintrinsic initialization mode enum value |
|
inline |
Set the intrinsic sensor height.
| [in] | height | The sensor height |
|
inline |
Set the intrinsic sensor width.
| [in] | width | The sensor width |
|
inline |
Set the serial number.
| [in] | serialNumber | The serial number |
|
inline |
mutator for the estimator state
| state | the new state of the intrinsic |
|
inline |
Set the intrinsic image width.
| [in] | width | The image width |
|
pure virtual |
Transform a given point (in pixels) to unit sphere in meters.
| pt | the input point |
Implemented in aliceVision::camera::Pinhole, aliceVision::camera::Equidistant, and aliceVision::camera::Equirectangular.
|
pure virtual |
Projection of a 3D point into the camera plane (Apply pose, disto (if any) and Intrinsics)
| [in] | pose | The pose |
| [in] | pt3D | The 3D point |
| [in] | applyDistortion | If true, apply the distortion if there is any |
Implemented in aliceVision::camera::Pinhole, aliceVision::camera::Equidistant, and aliceVision::camera::Equirectangular.
|
inline |
Projection of a 3D point into the camera plane (Apply pose, disto (if any) and Intrinsics)
| [in] | pose | The pose |
| [in] | pt3D | The 3D point |
| [in] | applyDistortion | If true, apply the distortion if there is any |
|
pure virtual |
Update intrinsic parameters.
| [in] | intrinsic | parameters |
Implemented in aliceVision::camera::IntrinsicScaleOffsetDisto, and aliceVision::camera::IntrinsicScaleOffset.
|
inline |
Get the intrinsic image width.
1.8.17