diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/argaze/ArUcoMarkers/ArUcoCamera.py | 26 |
1 files changed, 19 insertions, 7 deletions
diff --git a/src/argaze/ArUcoMarkers/ArUcoCamera.py b/src/argaze/ArUcoMarkers/ArUcoCamera.py index 92cde9f..06438ac 100644 --- a/src/argaze/ArUcoMarkers/ArUcoCamera.py +++ b/src/argaze/ArUcoMarkers/ArUcoCamera.py @@ -4,20 +4,26 @@ import json import numpy import cv2.aruco as aruco +K0 = numpy.array([[1., 0., 0.], [0., 1., 0.], [0., 0., 0.]]) +"""Define default camera intrinsic parameters matrix.""" + +D0 = numpy.array([0.0, 0.0, 0.0, 0.0, 0.0]) +"""Define default camera distorsion coefficients vector.""" + class ArUcoCamera(): - """Handle optical parameters with: - - camera matrix as K, - - camera distorsion coefficients as D.""" + """Handle optical calibration data with: + - camera intrinsic parameters matrix as K (focal lengths and principal point), + - camera distorsion coefficients vector as D.""" def __init__(self): """Define optical parameters.""" - self.__rms = 0 # root mean square error + self.__rms = 0 - self.__dimensions = [0, 0] # dimensions of frame where to apply optical parameters (in pixel) + self.__dimensions = [0, 0] - self.__K = [] # intrinsic parameters matrix (focal lengths and principal point) - self.__D = [] # distortion coefficients vector + self.__K = K0 + self.__D = D0 # define calibration data self.__corners_set_number = 0 @@ -55,6 +61,12 @@ class ArUcoCamera(): return self.__rms @property + def dimensions(self) -> list: + """Get camera frame dimensions in pixels from which the calibration have been done.""" + + return self.__dimensions + + @property def K(self) -> numpy.array: """Get camera intrinsic parameters matrix.""" |