Skip to content

Commit 842754c

Browse files
committed
do not ignore height parameter of sensor if given and therefore do not force square sensor pixels (#20)
1 parent fefacbd commit 842754c

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

cameratransform/projection.py

+4-1
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,10 @@ def __init__(self, focallength_px=None, focallength_x_px=None, focallength_y_px=
124124
elif focallength_mm is not None and sensor_width_mm is not None:
125125
focallength_px = focallength_mm / sensor_width_mm * image_width_px
126126
focallength_x_px = focallength_px
127-
focallength_y_px = focallength_px
127+
if sensor_height_mm is not None:
128+
focallength_y_px = focallength_mm / sensor_height_mm * image_height_px
129+
else:
130+
focallength_y_px = focallength_px
128131

129132
self.parameters = ParameterSet(
130133
# the intrinsic parameters

0 commit comments

Comments
 (0)