diff --git a/openptv_python/calibration.py b/openptv_python/calibration.py index bb59f8e..a0a7077 100644 --- a/openptv_python/calibration.py +++ b/openptv_python/calibration.py @@ -100,27 +100,6 @@ def set_back_focal_distance(self, cc: float) -> None: """Set the back focal distance of the camera.""" self.cc = cc - -# class Glass: -# """Glass data structure.""" - -# def __init__(self, vec_x=0.0, vec_y=0.0, vec_z=1.0): -# self.vec_x = vec_x -# self.vec_y = vec_y -# self.vec_z = vec_z - -# def set_glass_vec(self, vec: np.ndarray) -> None: -# """Set the glass vector.""" -# self.vec_x, self.vec_y, self.vec_z = vec - -Glass_dtype = np.dtype( - [ - ("vec_x", np.float64), - ("vec_y", np.float64), - ("vec_z", np.float64), - ] -) - def default_glass_vec() -> np.ndarray: """Return default glass vector.""" return vec_set(0.0, 0.0, 1.0) @@ -174,7 +153,7 @@ def __init__(self, ext_par=None, int_par=None, glass_par=None, added_par=None, m if int_par is None: int_par = Interior() if glass_par is None: - glass_par = default_glass_vec() + glass_par = np.array([0.0, 0.0, 1.0]) if added_par is None: added_par = ap_52() if mmlut is None: @@ -418,7 +397,7 @@ def set_glass_vec(self, gvec: np.ndarray): self.glass_par = gvec def get_glass_vec(self) -> np.ndarray: - """Return the glass vector, a 3-element array of Glass_dtype.""" + """Return the glass vector, a 3-element array of float.""" return self.glass_par def set_added_par(self, listpar: np.ndarray | list): @@ -518,8 +497,8 @@ def compare_glass(g1: np.ndarray, g2: np.ndarray) -> bool: Args: ---- - g1 (Glass_dtype): vector pointing from the 3D origin to the surface of the glass - g2 (Glass_dtype): another vector for comparison + g1 (float array): vector pointing from the 3D origin to the surface of the glass + g2 (float array): another vector for comparison Returns ------- diff --git a/tests/test_multimedia_r_nlay.py b/tests/test_multimedia_r_nlay.py index 710fb01..0cb8385 100644 --- a/tests/test_multimedia_r_nlay.py +++ b/tests/test_multimedia_r_nlay.py @@ -5,7 +5,6 @@ from openptv_python.calibration import ( Calibration, Exterior, - Glass_dtype, Interior, ap_52, ) @@ -29,7 +28,7 @@ def test_multimedia_r_nlay(self): ) test_I = Interior(0.0, 0.0, 100.0) - test_G = np.array([(0.0001, 0.00001, 1.0)], dtype=Glass_dtype).view(np.recarray) + test_G = np.array((0.0001, 0.00001, 1.0)) test_addp = ap_52(0.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0) test_cal = Calibration( test_Ex, test_I, test_G, test_addp