Skip to content

Commit 656a5ea

Browse files
committed
For version 1.7.0
1 parent f9b266b commit 656a5ea

File tree

3 files changed

+20
-6
lines changed

3 files changed

+20
-6
lines changed

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -105,9 +105,9 @@ Demonstrations
105105

106106
![webcam_after](https://github.com/DiamondLightSource/discorpy/raw/master/data/demo/checkboard_after.jpg)
107107

108-
- Calibrate a fisheye camera (GoPro Hero-8).
108+
- Calibrate a [fisheye](https://discorpy.readthedocs.io/en/latest/technical_notes/fisheye_correction.html) camera (GoPro Hero-8).
109109

110-
![GoPro_Hero8](./data/demo/fisheye_calibration.jpg)
110+
![GoPro_Hero8](https://github.com/DiamondLightSource/discorpy/raw/master/data/demo/fisheye_calibration.jpg)
111111

112112
- Apply to a hazard camera of the [Mars Perseverance Rover](https://mars.nasa.gov/mars2020/multimedia/raw-images/).
113113
Details of how to estimate distortion coefficients of that camera without using

tests/test_preprocessing.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424
Tests for methods in preprocessing.py
2525
"""
2626

27+
import os
2728
import unittest
2829
import numpy as np
2930
import scipy.ndimage as ndi
@@ -272,7 +273,10 @@ def test_remove_subset_points(self):
272273
def test_group_dots_based_polyfit(self):
273274
num_hor_line = 27
274275
num_ver_line = 37
275-
data = losa.load_python_list("./data_for_test/data_for_grouping.pkl")
276+
current_dir = os.path.dirname(__file__)
277+
data_path = os.path.join(current_dir, "data_for_test",
278+
"data_for_grouping.pkl")
279+
data = losa.load_python_list(data_path)
276280
slope_hor, dist_hor = data[0]
277281
slope_ver, dist_ver = data[1]
278282
points = np.asarray(data[2])

tests/test_processing.py

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424
Tests for methods in processing.py
2525
"""
2626

27+
import os
2728
import unittest
2829
import numpy as np
2930
import discorpy.proc.processing as proc
@@ -267,7 +268,10 @@ def test_transform_coef_backward_and_forward(self):
267268
self.assertTrue(num1 <= 1.0e-3 and num2 <= 1.0e-3)
268269

269270
def test_find_center_based_vanishing_points(self):
270-
data = losa.load_python_list("./data_for_test/data_for_pers_cod.pkl")
271+
current_dir = os.path.dirname(__file__)
272+
data_path = os.path.join(current_dir, "data_for_test",
273+
"data_for_pers_cod.pkl")
274+
data = losa.load_python_list(data_path)
271275
list_hor_lines, list_ver_lines = data
272276
xcenter0, ycenter0 = 2005, 1520
273277
xcenter1, ycenter1 = proc.find_center_based_vanishing_points(
@@ -277,7 +281,10 @@ def test_find_center_based_vanishing_points(self):
277281
self.assertTrue(num1 <= 10.0 and num2 <= 10.0)
278282

279283
def test_correct_perspective_effect(self):
280-
data = losa.load_python_list("./data_for_test/data_for_pers_cod.pkl")
284+
current_dir = os.path.dirname(__file__)
285+
data_path = os.path.join(current_dir, "data_for_test",
286+
"data_for_pers_cod.pkl")
287+
data = losa.load_python_list(data_path)
281288
list_hor_lines, list_ver_lines = data
282289
xcenter, ycenter = proc.find_center_based_vanishing_points(
283290
list_hor_lines, list_ver_lines)
@@ -295,7 +302,10 @@ def test_correct_perspective_effect(self):
295302
num3 <= 2.0e-3 and num4 <= 2.0e-3)
296303

297304
def test_find_center_based_vanishing_points_iteration(self):
298-
data = losa.load_python_list("./data_for_test/data_for_pers_cod.pkl")
305+
current_dir = os.path.dirname(__file__)
306+
data_path = os.path.join(current_dir, "data_for_test",
307+
"data_for_pers_cod.pkl")
308+
data = losa.load_python_list(data_path)
299309
list_hor_lines, list_ver_lines = data
300310
xcenter0, ycenter0 = 2005, 1520
301311
xcenter1, ycenter1 = proc.find_center_based_vanishing_points_iteration(

0 commit comments

Comments
 (0)