Skip to content

Commit

Permalink
fixed test_lens
Browse files Browse the repository at this point in the history
  • Loading branch information
rgerum committed Sep 21, 2021
1 parent 330e7f2 commit 1ff77ff
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions tests/test_transforms.py
Original file line number Diff line number Diff line change
Expand Up @@ -166,6 +166,9 @@ def test_lens(self, lens, proj, k):
pos0 = np.round(np.array([x, y]).T).astype(int)
pos1 = cam.lens.distortedFromImage(pos0)
pos2 = np.round(cam.lens.imageFromDistorted(pos1))
# set the points that cannot be back projected (because they are nan in the distorted image) to nan
pos0 = pos0.astype(np.float)
pos0[np.isnan(pos2[:, 0])] = np.nan
np.testing.assert_almost_equal(pos2, pos0, 0, err_msg="Transforming from distorted to undistorted image fails.")

@given(ct_st.camera_image_points(), st.floats(0, 100))
Expand Down

0 comments on commit 1ff77ff

Please sign in to comment.