matlab calibration camera internal reference

1. Obtain monocular pinhole camera data

Select Camera Calibrator in the APP, as follows:
insert image description here
Click Add Images to import photos. It is enough to calibrate about 20 images, and then change the angle, but it does not need to be too large, too large will affect the calibration effect. The calibration plate is preferably in the center of the field of view and occupies a large area.
insert image description here
Modify the size of the checkerboard to 27*27mm (my A4 paper measurement is like this).
insert image description here
For standard cameras, select third-order radial distortion and oblique cutting in the option of the menu bar:
insert image description here
for fisheye cameras, select
insert image description here

Click Calibrate to perform camera calibration:
the upper right corner is the reconstruction average error, as long as the average error is less than 0.5, it can be considered that the result of camera calibration is reliable. It's too big here hahaha:
insert image description hereExport the camera parameters and click Export Camera Parameters. Click OK, and you can see the camera parameters appear in the matlab workspace. Click on this parameter, you can get the various parameters of the camera:
insert image description here

  1. ImageSize: image size
  2. Radial Distortion: radial distortion
  3. Tangential Distortion: Tangential Distortion
  4. World Points: points in the world coordinate system
  5. World Units: Units in world coordinates
  6. Estimate Skew: Estimated Skew
  7. Num Radial Distortion Coefficient: the number of radial distortion coefficients
  8. Estimate Tangential Distortion: Estimate tangential distortion
  9. Translation Vectors: translation vector
  10. Reprojection Errors: reprojection errors
  11. Detected Keypoints: Detected key points
  12. Rotation Vectors: rotation vector
  13. Num Patterns: number of modes
  14. Intrinsics: internal reference
  15. Intrinsic Matrix: internal reference matrix
  16. Focal Length: focal length
  17. Principal Point: Principal point offset
  18. Skew: Skew
  19. Mean Reprojection Error: Average reprojection error
  20. Reprojected Points: Reprojection points
  21. Rotation Matrices: The rotation matrix
    results are as follows:
    insert image description here

2. Make monocular camera yaml file

%YAML:1.0

#--------------------------------------------------------------------------------------------
# Camera Parameters. Adjust them!
#--------------------------------------------------------------------------------------------
Camera.type: "PinHole"

# Camera calibration and distortion parameters (OpenCV) 
Camera.fx: 1715.3730
Camera.fy: 1702.5771
Camera.cx: 1129.8076
Camera.cy: 642.5709

Camera.k1: 0.02724
Camera.k2: -0.097636
Camera.k3: 0.10436
Camera.p1: 0.0000127185
Camera.p2: -0.001243

# Camera frames per second 
Camera.fps: 30.0

# Color order of the images (0: BGR, 1: RGB. It is ignored if images are grayscale)
Camera.RGB: 0

# Camera resolution
Camera.width: 640
Camera.height: 480

#--------------------------------------------------------------------------------------------
# ORB Parameters
#--------------------------------------------------------------------------------------------

# ORB Extractor: Number of features per image
ORBextractor.nFeatures: 1000

# ORB Extractor: Scale factor between levels in the scale pyramid 	
ORBextractor.scaleFactor: 1.2

# ORB Extractor: Number of levels in the scale pyramid	
ORBextractor.nLevels: 8

# ORB Extractor: Fast threshold
# Image is divided in a grid. At each cell FAST are extracted imposing a minimum response.
# Firstly we impose iniThFAST. If no corners are detected we impose a lower value minThFAST
# You can lower these values if your images have low contrast			
ORBextractor.iniThFAST: 20
ORBextractor.minThFAST: 7

#--------------------------------------------------------------------------------------------
# Viewer Parameters
#--------------------------------------------------------------------------------------------
Viewer.KeyFrameSize: 0.05
Viewer.KeyFrameLineWidth: 5
Viewer.GraphLineWidth: 0.9
Viewer.PointSize: 2
Viewer.CameraSize: 0.08
Viewer.CameraLineWidth: 3
Viewer.ViewpointX: 0
Viewer.ViewpointY: -0.7
Viewer.ViewpointZ: -1.8
Viewer.ViewpointF: 500

3. Obtain fisheye camera data

Reference link . Photo ditto. The difference here is
insert image description here
that the camera model selects fisheye, and the estimate alignment selects tick, because the official website explains

Estimate the axes alignment, specified as the comma-separated pair consisting of 'EstimateAlignment' and false or true. Set to true if the optical axis of the fisheye lens is not perpendicular to the image plane. Estimate the alignment of the coordinate axes, specified as a
comma A separated pair consisting of 'EstimateAlignment' and false or true. Set to true if the optical axis of the fisheye lens is not perpendicular to the image plane.

Check the Intrinsics Mapping Coefficients in the calculation result cameraParams
insert image description here
: mapping coefficient, [ a 0 a 2 a 3 a 4 ] \left[ \begin{matrix} { {a}_{0}} & { {a}_{2}} & { {a}_{3}} & { {a}_{4}} \end{matrix} \right][a0a2a3a4], a 1 = 1 { {a}_{1}}=1 a1=1
Image Size: image size
Distortion Center: distortion center
Stretch Matrix: stretch transformation,[ cde 1 ] \left[ \begin{matrix} c & d \\ e & 1 \\\end{matrix} \right][ced1]

Guess you like

Origin blog.csdn.net/miracle_world/article/details/127748071