Overview
Pinhole implements the standard pinhole camera model with perspective projection. It extends GeometricCamera and is used for conventional cameras with narrow to moderate field-of-view.
Header: CameraModels/Pinhole.h
Namespace: ORB_SLAM3
Base Class: GeometricCamera
Camera Parameters
The pinhole model uses 4 intrinsic parameters:fx- Focal length in x direction (pixels)fy- Focal length in y direction (pixels)cx- Principal point x coordinate (pixels)cy- Principal point y coordinate (pixels)
Constructors
_vParameters- Vector[fx, fy, cx, cy]
pPinhole- Source pinhole camera
Projection Methods
Project 3D points to 2D image coordinates using perspective projection.p3D/v3D- 3D point in camera coordinates
Unprojection Methods
Unproject 2D image points to 3D unit rays.p2D- 2D point in image coordinates (pixels)
Jacobian
v3D- 3D point in camera coordinates
Uncertainty
p2D- 2D point in image coordinates
Calibration Matrix
Two-View Reconstruction
vKeys1- Keypoints from first imagevKeys2- Keypoints from second imagevMatches12- Correspondences between viewsT21- Output: relative transformation from view 1 to view 2vP3D- Output: triangulated 3D pointsvbTriangulated- Output: success flags for each point
true if reconstruction successful
Process:
- Compute fundamental matrix from matches
- Recover essential matrix using K
- Decompose essential matrix to get R and t
- Triangulate points and check cheirality
Epipolar Constraint
pCamera2- Second camera modelkp1- Keypoint in first imagekp2- Keypoint in second imageR12- Rotation from camera 1 to 2t12- Translation from camera 1 to 2sigmaLevel- Uncertainty scale factorunc- Uncertainty threshold
true if epipolar constraint satisfied
Constraint: x2ᵀ * E * x1 = 0 where E = [t]×R
Comparison
pCam- Camera to compare against
true if parameters match
Stream Operators
Usage Example
Camera Type
Pinhole cameras have typeCAM_PINHOLE (value 0).
See Also
- GeometricCamera - Base class interface
- KannalaBrandt8 - Fisheye camera model
- Settings - Camera configuration loading