UPLOAD DATA
...
Indepth theory
Calibrations

Standard Camera Calibrations

12min
the camera calibration format is based on opencvs https //docs opencv org/3 4/d4/d94/tutorial camera calibration html format and this paper http //www robots ox ac uk/ cmei/articles/single viewpoint calib mei 07 pdf the different camera types supported are pinhole , fisheye , kannala , principalpointdist , and fusedcylindrical if your calibration model is not supported, you can also provide a custom camera calibrations docid\ f jarczytv6cxwzc675zk where you provide the implementation in the form of a webassembly module common all camera calibrations have the following attributes key value parameters rotation quaternion a rotationquaternion object w , x , y , z position a position object x , y , z camera matrix a cameramatrix object fx , fy , cx , cy image width integer na image height integer na field of view float na pinhole the pinhole camera model expands the common model with key value parameters distortion coefficients a distortioncoefficients object k1 , k2 , p1 , p2 , k3 from kognic io model calibration camera common import cameramatrix, distortioncoefficients from kognic io model calibration camera pinhole calibration import pinholecalibration from kognic io model calibration common import position, rotationquaternion def unity pinhole calibration() camera position = position(x=0 0, y=0 0, z=0 0) camera rotation = rotationquaternion(w=1 0, x=0 0, y=0 0, z=0 0) camera camera matrix = cameramatrix(fx=3450, fy=3250, cx=622, cy=400) camera distortion coefficients = distortioncoefficients(k1=0 0, k2=0 0, p1=0 0, p2=0 0, k3=1 0) return pinholecalibration( position=camera position, rotation quaternion=camera rotation, camera matrix=camera camera matrix, distortion coefficients=camera distortion coefficients, image height=1080, image width=1920, field of view=190 0, ) fisheye the fisheye camera model expands the pinhole model with the following key value parameters xi float na from kognic io model calibration camera common import cameramatrix, distortioncoefficients from kognic io model calibration camera fisheye calibration import fisheyecalibration from kognic io model calibration common import position, rotationquaternion def unity fisheye calibration() camera position = position(x=0 0, y=0 0, z=0 0) camera rotation = rotationquaternion(w=1 0, x=0 0, y=0 0, z=0 0) camera camera matrix = cameramatrix(fx=3450, fy=3250, cx=622, cy=400) camera distortion coefficients = distortioncoefficients(k1=0 0, k2=0 0, p1=0 0, p2=0 0, k3=0 1) return fisheyecalibration( position=camera position, rotation quaternion=camera rotation, camera matrix=camera camera matrix, distortion coefficients=camera distortion coefficients, image height=1080, image width=1920, xi=123 456, field of view=190 0, ) kannala the kannala camera model changes and expands the pinhole with the following key value parameters distortion coefficients a kannaladistortioncoefficients object the distortion parameters k3 , k4 , if available, can be assigned to p1 and p2 respectively that is p1=k3 and p2=k4 k1 , k2 , p1 , p2 undistortion coefficients a undistortioncoefficients object l1 , l2 , l3 , l4 from kognic io model calibration camera common import cameramatrix from kognic io model calibration camera kannala calibration import ( kannalacalibration, kannaladistortioncoefficients, undistortioncoefficients, ) from kognic io model calibration common import position, rotationquaternion def unity kannala calibration() camera position = position(x=0 0, y=0 0, z=0 0) # similar to lidar camera rotation = rotationquaternion(w=1 0, x=0 0, y=0 0, z=0 0) # similar to lidar camera camera matrix = cameramatrix(fx=3450, fy=3250, cx=622, cy=400) camera distortion coefficients = kannaladistortioncoefficients(k1=0 0, k2=0 0, p1=0 0, p2=0 0) camera undistortion coefficients = undistortioncoefficients(l1=0 0, l2=0 0, l3=0 0, l4=0 0) return kannalacalibration( position=camera position, rotation quaternion=camera rotation, camera matrix=camera camera matrix, distortion coefficients=camera distortion coefficients, undistortion coefficients=camera undistortion coefficients, image height=1080, image width=1920, field of view=180 0, ) principal point distortion the principal point distortion model consists of the common attributes plus key value parameters principal point distortion coefficients a principalpointdistortioncoefficients object k1 , k2 lens projection coefficients (optional default to values for model sf806) a lensprojectioncoefficients object c1 , c2 , c3 , c4 , c5 , c6 distortion center a distortioncenter object x , y principal point a principalpoint object x , y from kognic io model calibration camera common import cameramatrix from kognic io model calibration camera principal point distortion calibration import ( distortioncenter, lensprojectioncoefficients, principalpoint, principalpointdistortioncalibration, principalpointdistortioncoefficients, ) from kognic io model calibration common import position, rotationquaternion def unity principal point distortion calibration() camera position = position(x=0 0, y=0 0, z=0 0) camera rotation = rotationquaternion(w=1 0, x=0 0, y=0 0, z=0 0) camera camera matrix = cameramatrix(fx=3450, fy=3250, cx=622, cy=400) camera distortion coefficients = principalpointdistortioncoefficients(k1=0 0, k2=0 0) principal point = principalpoint(x=0 0, y=0 0) distortion center = distortioncenter(x=0 0, y=0 0) lens projection coefficients = lensprojectioncoefficients(c1=0 0, c2=0 0, c3=0 0, c4=0 0, c5=0 0, c6=0 0) return principalpointdistortioncalibration( position=camera position, rotation quaternion=camera rotation, camera matrix=camera camera matrix, principal point distortion coefficients=camera distortion coefficients, lens projection coefficients=lens projection coefficients, principal point=principal point, distortion center=distortion center, image height=1080, image width=1920, field of view=180 0, ) fused cylindrical the fused cylindrical model consists of the common attributes plus key value parameters cut angles degree a cutangles object note these angles should be expressed in degrees upper , lower vertical fov degree (optional default 72 5 degrees) float note this angle should be expressed in degrees na horizontal fov degree (optional default 93 degrees) float note this angle should be expressed in degrees na max altitude angle degree (optional default 90 degrees) float note this angle should be expressed in degrees na from kognic io model calibration camera common import cameramatrix from kognic io model calibration camera fused cylindrical calibration import cutangles, fusedcylindricalcalibration from kognic io model calibration common import position, rotationquaternion def example fused cylindrical calibration() camera position = position(x=0 0, y=0 0, z=0 0) camera rotation = rotationquaternion(w=1 0, x=0 0, y=0 0, z=0 0) camera camera matrix = cameramatrix(fx=400, fy=400, cx=600, cy=450) cut angles degree = cutangles(upper= 40 0, lower=30 0) return fusedcylindricalcalibration( position=camera position, rotation quaternion=camera rotation, camera matrix=camera camera matrix, image height=1080, image width=1920, cut angles degree=cut angles degree, vertical fov degree=70, horizontal fov degree=90 0, max altitude angle degree=90 0, ) cylindrical the cylindrical model consists only of the common attributes there are no extra attributes to set for this model from kognic io model calibration camera common import cameramatrix from kognic io model calibration camera cylindrical calibration import cylindricalcalibration from kognic io model calibration common import position, rotationquaternion def example cylindrical calibration() camera position = position(x=0 0, y=0 0, z=0 0) camera rotation = rotationquaternion(w=1 0, x=0 0, y=0 0, z=0 0) camera camera matrix = cameramatrix(fx=400, fy=400, cx=600, cy=450) return cylindricalcalibration( position=camera position, rotation quaternion=camera rotation, camera matrix=camera camera matrix, image height=1080, image width=1920, ) principal point fisheye the principal point fisheye model consists of the common attributes plus key value parameters principal point fisheye coefficients a principalpointfisheyecoefficients object alpha l , alpha r , beta u , beta l from kognic io model calibration camera common import cameramatrix from kognic io model calibration camera principal point fisheye calibration import ( principalpointfisheyecalibration, principalpointfisheyecoefficients, ) from kognic io model calibration common import position, rotationquaternion def unity principal point fisheye calibration() camera position = position(x=0 0, y=0 0, z=0 0) camera rotation = rotationquaternion(w=1 0, x=0 0, y=0 0, z=0 0) camera camera matrix = cameramatrix(fx=3450, fy=3250, cx=622, cy=400) principal point fisheye coefficients = principalpointfisheyecoefficients(alpha l=0 0, alpha r=0 0, beta u=0 0, beta l=0 0) return principalpointfisheyecalibration( position=camera position, rotation quaternion=camera rotation, camera matrix=camera camera matrix, principal point fisheye coefficients=principal point fisheye coefficients, image height=1080, image width=1920, field of view=180 0, )