Skip to content

Commit b4ee139

Browse files
committed
cleaning glass
1 parent df1eeb3 commit b4ee139

2 files changed

Lines changed: 5 additions & 27 deletions

File tree

openptv_python/calibration.py

Lines changed: 4 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -100,27 +100,6 @@ def set_back_focal_distance(self, cc: float) -> None:
100100
"""Set the back focal distance of the camera."""
101101
self.cc = cc
102102

103-
104-
# class Glass:
105-
# """Glass data structure."""
106-
107-
# def __init__(self, vec_x=0.0, vec_y=0.0, vec_z=1.0):
108-
# self.vec_x = vec_x
109-
# self.vec_y = vec_y
110-
# self.vec_z = vec_z
111-
112-
# def set_glass_vec(self, vec: np.ndarray) -> None:
113-
# """Set the glass vector."""
114-
# self.vec_x, self.vec_y, self.vec_z = vec
115-
116-
Glass_dtype = np.dtype(
117-
[
118-
("vec_x", np.float64),
119-
("vec_y", np.float64),
120-
("vec_z", np.float64),
121-
]
122-
)
123-
124103
def default_glass_vec() -> np.ndarray:
125104
"""Return default glass vector."""
126105
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
174153
if int_par is None:
175154
int_par = Interior()
176155
if glass_par is None:
177-
glass_par = default_glass_vec()
156+
glass_par = np.array([0.0, 0.0, 1.0])
178157
if added_par is None:
179158
added_par = ap_52()
180159
if mmlut is None:
@@ -418,7 +397,7 @@ def set_glass_vec(self, gvec: np.ndarray):
418397
self.glass_par = gvec
419398

420399
def get_glass_vec(self) -> np.ndarray:
421-
"""Return the glass vector, a 3-element array of Glass_dtype."""
400+
"""Return the glass vector, a 3-element array of float."""
422401
return self.glass_par
423402

424403
def set_added_par(self, listpar: np.ndarray | list):
@@ -518,8 +497,8 @@ def compare_glass(g1: np.ndarray, g2: np.ndarray) -> bool:
518497
519498
Args:
520499
----
521-
g1 (Glass_dtype): vector pointing from the 3D origin to the surface of the glass
522-
g2 (Glass_dtype): another vector for comparison
500+
g1 (float array): vector pointing from the 3D origin to the surface of the glass
501+
g2 (float array): another vector for comparison
523502
524503
Returns
525504
-------

tests/test_multimedia_r_nlay.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
from openptv_python.calibration import (
66
Calibration,
77
Exterior,
8-
Glass_dtype,
98
Interior,
109
ap_52,
1110
)
@@ -29,7 +28,7 @@ def test_multimedia_r_nlay(self):
2928
)
3029

3130
test_I = Interior(0.0, 0.0, 100.0)
32-
test_G = np.array([(0.0001, 0.00001, 1.0)], dtype=Glass_dtype).view(np.recarray)
31+
test_G = np.array((0.0001, 0.00001, 1.0))
3332
test_addp = ap_52(0.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0)
3433
test_cal = Calibration(
3534
test_Ex, test_I, test_G, test_addp

0 commit comments

Comments
 (0)