Skip to content

Commit

Permalink
one more edge case
Browse files Browse the repository at this point in the history
  • Loading branch information
scottshambaugh committed Dec 21, 2023
1 parent 90e19f3 commit efd393d
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/mpl_stereo/AxesStereo.py
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,8 @@ def calc_2d_offsets(eye_balance: float, z: np.ndarray, d: float, ipd: float,
z_range = np.ptp(z)
if z_range == 0: # If all the z values are the same
z_range = np.max(abs(z))
if z_range == 0:
z_range = 1
z_midpoint = np.min(z) + z_range/2
if z_zero is None:
z_zero = z_midpoint
Expand Down

0 comments on commit efd393d

Please sign in to comment.