 |
AliceVision
Photogrammetric Computer Vision Framework
|
10 #include <aliceVision/numeric/numeric.hpp>
11 #include <aliceVision/numeric/projection.hpp>
12 #include <aliceVision/geometry/Pose3.hpp>
13 #include <aliceVision/camera/cameraCommon.hpp>
14 #include <aliceVision/camera/IntrinsicScaleOffsetDisto.hpp>
28 :
Pinhole(1, 1, 1.0, 1.0, 0.0, 0.0)
31 Pinhole(
unsigned int w,
unsigned int h,
const Mat3& K)
37 double focalLengthPixX,
38 double focalLengthPixY,
41 std::shared_ptr<Distortion> distortion =
nullptr,
42 std::shared_ptr<Undistortion> undistortion =
nullptr)
52 static std::shared_ptr<Pinhole> cast(std::shared_ptr<IntrinsicBase> sptr);
54 double getFocalLengthPixX()
const {
return _scale(0); }
56 double getFocalLengthPixY()
const {
return _scale(1); }
60 EINTRINSIC
getType()
const override;
64 void setK(
double focalLengthPixX,
double focalLengthPixY,
double ppx,
double ppy);
66 void setK(
const Mat3& K);
68 Vec2 transformProject(
const geometry::Pose3& pose,
const Vec4& pt3D,
bool applyDistortion =
true)
const
70 return transformProject(pose.getHomogeneous(), pt3D, applyDistortion);
73 Vec2 transformProject(
const Eigen::Matrix4d& pose,
const Vec4& pt,
bool applyDistortion =
true)
const override;
75 Vec2
project(
const Vec4& pt,
bool applyDistortion =
true)
const override;
79 Eigen::Matrix<double, 2, 2> getDerivativeTransformProjectWrtPrincipalPoint(
const Eigen::Matrix4d& pose,
const Vec4& pt)
const;
81 Eigen::Matrix<double, 2, 2> getDerivativeTransformProjectWrtScale(
const Eigen::Matrix4d& pose,
const Vec4& pt)
const;
85 Eigen::Matrix<double, 2, Eigen::Dynamic> getDerivativeTransformProjectWrtDistortion(
const Eigen::Matrix4d& pose,
const Vec4& pt)
const override;
87 Eigen::Matrix<double, 3, Eigen::Dynamic> getDerivativeBackProjectUnitWrtDistortion(
const Vec2& pt2D)
const override;
91 Eigen::Matrix<double, 3, 2> getDerivativetoUnitSphereWrtPoint(
const Vec2& pt)
const;
Eigen::Matrix< double, 2, 3 > getDerivativeTransformProjectWrtPoint3(const Eigen::Matrix4d &pose, const Vec4 &pt) const override
Get the derivative of a projection of a 3D point into the camera plane.
Definition: Pinhole.cpp:61
EINTRINSIC getType() const override
Get embed camera type.
Definition: Pinhole.cpp:221
bool isVisibleRay(const Vec3 &ray) const override
Return true if this ray should be visible in the image.
Definition: Pinhole.cpp:193
Vec3 toUnitSphere(const Vec2 &pt) const override
Transform a given point (in pixels) to unit sphere in meters.
Definition: Pinhole.cpp:132
unsigned int h() const
Get the intrinsic image height.
Definition: IntrinsicBase.hpp:58
void assign(const IntrinsicBase &other) override
Assign object.
Definition: Pinhole.hpp:50
bool isValid() const override
Return true if the intrinsic is valid.
Definition: Pinhole.hpp:58
Pinhole * clone() const override
Polymorphic clone.
Definition: Pinhole.hpp:48
virtual bool isValid() const
Return true if the intrinsic is valid.
Definition: IntrinsicBase.hpp:379
Definition: checkerDetector.cpp:32
unsigned int w() const
Get the intrinsic image width.
Definition: IntrinsicBase.hpp:52
double imagePlaneToCameraPlaneError(double value) const override
Normalize a given unit pixel error to the camera plane.
Definition: Pinhole.cpp:183
Class with disto.
Definition: IntrinsicScaleOffsetDisto.hpp:23
double pixelProbability() const override
how a one pixel change relates to an angular change
Definition: Pinhole.cpp:235
double getVerticalFov() const override
Get the vertical FOV in radians.
Definition: Pinhole.cpp:229
Eigen::Matrix< double, 3, Eigen::Dynamic > getDerivativeBackProjectUnitWrtParams(const Vec2 &pt2D) const override
Get the derivative of the unit sphere backprojection.
Definition: Pinhole.cpp:156
Vec2 project(const Vec4 &pt, bool applyDistortion=true) const override
Projection of a 3D point into the camera plane (Apply disto (if any) and Intrinsics)
Definition: Pinhole.cpp:51
Basis class for all intrinsic parameters of a camera.
Definition: IntrinsicBase.hpp:27
double getHorizontalFov() const override
Get the horizontal FOV in radians.
Definition: Pinhole.cpp:223
Define a classic Pinhole camera.
Definition: Pinhole.hpp:24
Eigen::Matrix< double, 2, Eigen::Dynamic > getDerivativeTransformProjectWrtParams(const Eigen::Matrix4d &pose, const Vec4 &pt3D) const override
Get the derivative of a projection of a 3D point into the camera plane.
Definition: Pinhole.cpp:122