This class implements functions to calibrate a camera, to determine the profile of a camera.
More...
|
class | Pattern |
| Definition of a class holding the information about one calibration pattern. More...
|
|
|
static bool | determineCameraCalibrationPlanar (const unsigned int width, const unsigned int height, const ConstIndexedAccessor< Vectors3 > &objectPointGroups, const ConstIndexedAccessor< Vectors2 > &imagePointGroups, PinholeCamera &pinholeCamera, const unsigned int iterations=20u, Scalar *sqrAccuracy=nullptr) |
| Determines the camera calibration for several individual groups of 3D object points all lying on the same 3D plane and corresponding 2D image points. More...
|
|
static bool | determineIntrinsicCameraMatrixPlanar (const ConstIndexedAccessor< Vectors3 > &objectPointGroups, const ConstIndexedAccessor< Vectors2 > &imagePointGroups, SquareMatrix3 &intrinsic, SquareMatrices3 *homographies=nullptr, Indices32 *validGroupIndices=nullptr) |
| Determines the intrinsic camera matrix for several groups of corresponding 2D/3D points. More...
|
|
static bool | determineCameraCalibration (const PinholeCamera &roughCamera, const ObjectPointGroups &objectPointGroups, const ImagePointGroups &imagePointGroups, PinholeCamera &pinholeCamera, Scalar *sqrAccuracy=nullptr) |
| Determines the camera calibration while a rough camera calibration is already known. More...
|
|
static bool | createCorrespondences (const Pattern &pattern, const Vector2 &boxSize, ObjectPoints &objectPoints, ImagePoints &imagePoints) |
| Creates point correspondences from a given calibration pattern. More...
|
|
static bool | determineBestMatchingFovX (const unsigned int width, const unsigned int height, const ConstIndexedAccessor< HomogenousMatrix4 > &posesAccessor, const ConstIndexedAccessor< Vectors3 > &objectPointGroupAccessor, const ConstIndexedAccessor< Vectors2 > &imagePointGroupAccessor, Scalar &idealFovX, const bool twoIterations=true, const Scalar lowestFovX=Numeric::deg2rad(25), const Scalar highestFovX=Numeric::deg2rad(75), const unsigned int steps=20u, NonconstIndexedAccessor< HomogenousMatrix4 > *idealPoses=nullptr) |
| Determines the horizontal field of view that matches best to a set of poses, object point and image points. More...
|
|
static bool | successiveCameraPoseOptimization (const PinholeCamera &pinholeCamera, const HomogenousMatrices4 &poses, const ObjectPointGroups &objectPointGroups, const ImagePointGroups &imagePointGroups, PinholeCamera &optimizedCamera, HomogenousMatrices4 &optimizedPoses, Scalar *initialSqrError=nullptr, Scalar *finalSqrError=nullptr) |
| Applies one camera and one pose optimization successively for a given set of poses and corresponding image and object points. More...
|
|
This class implements functions to calibrate a camera, to determine the profile of a camera.
Use CameraCalibration::determineCameraCalibrationPlanar() for groups of 2D/3D point correspondences with all 3D object points located on one plane.
Use CameraCalibration::determineCameraCalibration() for groups of 2D/3D point correspondences with any kind of 3D object points.
◆ Patterns
Definition of a vector holding calibration patterns.
◆ createCorrespondences()
Creates point correspondences from a given calibration pattern.
- Parameters
-
pattern | Calibration patter to create the correspondences from |
boxSize | Size of one calibration box in m |
objectPoints | Resulting object points |
imagePoints | Resulting image points |
- Returns
- True, if succeeded
◆ determineBestMatchingFovX()
static bool Ocean::Geometry::CameraCalibration::determineBestMatchingFovX |
( |
const unsigned int |
width, |
|
|
const unsigned int |
height, |
|
|
const ConstIndexedAccessor< HomogenousMatrix4 > & |
posesAccessor, |
|
|
const ConstIndexedAccessor< Vectors3 > & |
objectPointGroupAccessor, |
|
|
const ConstIndexedAccessor< Vectors2 > & |
imagePointGroupAccessor, |
|
|
Scalar & |
idealFovX, |
|
|
const bool |
twoIterations = true , |
|
|
const Scalar |
lowestFovX = Numeric::deg2rad(25) , |
|
|
const Scalar |
highestFovX = Numeric::deg2rad(75) , |
|
|
const unsigned int |
steps = 20u , |
|
|
NonconstIndexedAccessor< HomogenousMatrix4 > * |
idealPoses = nullptr |
|
) |
| |
|
static |
Determines the horizontal field of view that matches best to a set of poses, object point and image points.
- Parameters
-
width | The width of the camera in pixel, with range [1, infinity) |
height | The height of the camera in pixel, with range [1, infinity) |
posesAccessor | The accessor for the poses that match to the number of given object point groups (and image point groups) |
objectPointGroupAccessor | The accessor for the individual groups of object points, one group for each group of image points |
imagePointGroupAccessor | The accessor for the individual groups of image points, one group for each group of object points with same nubmer of elements |
twoIterations | True, to apply a two-iteration approach, otherwise a faster one-iteration approach will be applied |
idealFovX | Resulting best matching horizontal field of view, in radian |
lowestFovX | Lowest field of view that will be tested in radian, with range (0, highestFovX) |
highestFovX | Highest field of view that will be tested in radian, with range (lowestFovX, PI) |
steps | Number of angles that will be tested, with range [1, infinity) |
idealPoses | Optional resulting poses corresponding to the given sets of object and image points and the found fovX |
- Returns
- True, if succeeded
◆ determineCameraCalibration()
Determines the camera calibration while a rough camera calibration is already known.
The camera calibration is improved by usage of all given groups of point correspondences.
The individual groups of image points can be arbitrary and do not need to be based on a planar calibration pattern.
The camera profile must not change between individual groups (images of the calibration pattern).
- Parameters
-
roughCamera | Rough camera object already determined, must be valid |
objectPointGroups | Groups of object points, each group corresponds to a group of image points, at least one |
imagePointGroups | Groups of image points, each group corresponds to a group of object points, at least one |
pinholeCamera | Resulting pinhole camera holding all extracted calibration information like e.g. intrinsic camera and distortion parameters |
sqrAccuracy | Optional resulting average square pixel error, if defined |
- Returns
- True, if succeeded
- See also
- determineCameraCalibrationPlanar().
◆ determineCameraCalibrationPlanar()
Determines the camera calibration for several individual groups of 3D object points all lying on the same 3D plane and corresponding 2D image points.
The camera calibration is determines by usage of all given correspondences.
The individual groups of image points can e.g., be the result of individual images of a calibration pattern observed from different viewing positions.
The camera profile must not change between individual groups (images of the calibration pattern).
Each group must provide at least 10 points.
- Parameters
-
width | The width of the camera frame in pixel, with range [1, infinity) |
height | The height of the camera frame in pixel, with range [1, infinity) |
objectPointGroups | The groups of object points (all points lie in the Z == 0 plane), each group has a corresponding group of image points, at least 3 |
imagePointGroups | The groups of image points, each group has a corresponding group of object points |
pinholeCamera | Resulting pinhole camera profile holding all extracted calibration information like e.g. intrinsic camera and distortion parameters |
iterations | Number of iterations the camera parameters will be improved after the initial model has been determined, using a non linear optimization approach, with range [0, infinity) |
sqrAccuracy | Optional resulting average square pixel error for all point correspondences |
- Returns
- True, if succeeded
- See also
- determineCameraCalibration().
◆ determineIntrinsicCameraMatrixPlanar()
Determines the intrinsic camera matrix for several groups of corresponding 2D/3D points.
All 3D object points must be located on a plane. Each group must provide at least 10 points.
- Parameters
-
objectPointGroups | Groups of object points, each group corresponds to a group of image points, at least three |
imagePointGroups | Groups of image points, each group corresponds to a group of object points, at least three |
intrinsic | Resulting intrinsic camera matrix |
homographies | Optional resulting homographies, one for each given group for which a valid homography could be determined, may be less than the provided number of groups |
validGroupIndices | Optional resulting indices of the valid groups for which a valid homography could be determined |
- Returns
- True, if succeeded
◆ successiveCameraPoseOptimization()
Applies one camera and one pose optimization successively for a given set of poses and corresponding image and object points.
- Parameters
-
pinholeCamera | The initial pinhole camera object that has to be optimized according to the projection error of the given point sets |
poses | A set of camera poses, each pose corresponds to a group of image and object points |
objectPointGroups | Groups of object points, each group corresponds to one camera pose and the group of image points |
imagePointGroups | Groups of image points, each group corresponds to one camera pose and the group of object points |
optimizedCamera | Resulting optimized camera |
optimizedPoses | Resulting optimized poses |
initialSqrError | Optional initial average sqr projection error |
finalSqrError | Optional resulting final average sqr projection error |
- Returns
- True, if succeeded
The documentation for this class was generated from the following file: