|
1 | 1 | #!/usr/bin/env python3 |
2 | | - |
3 | | -from os.path import dirname, basename, join, split, realpath |
4 | | - |
5 | | -# from collections import NoneType |
6 | | - |
7 | | -path = dirname(realpath(__file__)) |
8 | | -CAM_DIR = join(path, "rsc", "camera") |
| 2 | +from os.path import dirname, join, realpath |
9 | 3 |
|
10 | 4 | import pytest |
11 | 5 | import logging |
12 | 6 | import cv2 |
13 | 7 | import numpy as np |
14 | 8 | from octoprint_mrbeam.camera.undistort import prepareImage |
| 9 | +from octoprint_mrbeam.camera.lens import BoardDetectorDaemon |
| 10 | +import octoprint_mrbeam.camera.lens as lens |
| 11 | +import time |
| 12 | + |
| 13 | + |
| 14 | +path = dirname(realpath(__file__)) |
| 15 | +CAM_DIR = join(path, "..", "rsc", "camera") |
15 | 16 |
|
16 | 17 |
|
17 | 18 | @pytest.mark.datafiles( |
@@ -42,25 +43,16 @@ def test_undist(datafiles): |
42 | 43 | assert res[5]["lens_corrected"] |
43 | 44 |
|
44 | 45 |
|
45 | | -from octoprint_mrbeam.camera.lens import BoardDetectorDaemon |
46 | | -import octoprint_mrbeam.camera.lens as lens |
47 | | -import yaml, time |
48 | | - |
49 | 46 | BOARD_IMGS = tuple("tmp_raw_img_0%02i.jpg" % i for i in range(21, 31)) |
50 | 47 |
|
| 48 | + |
51 | 49 | BOARDS = pytest.mark.datafiles( |
52 | 50 | join(CAM_DIR, "boards", "tmp_raw_img_021.jpg"), |
53 | | - join(CAM_DIR, "boards", "tmp_raw_img_021.jpg.npz"), |
54 | 51 | join(CAM_DIR, "boards", "tmp_raw_img_022.jpg"), |
55 | | - join(CAM_DIR, "boards", "tmp_raw_img_022.jpg.npz"), |
56 | 52 | join(CAM_DIR, "boards", "tmp_raw_img_023.jpg"), |
57 | 53 | join(CAM_DIR, "boards", "tmp_raw_img_024.jpg"), |
58 | 54 | join(CAM_DIR, "boards", "tmp_raw_img_025.jpg"), |
59 | 55 | join(CAM_DIR, "boards", "tmp_raw_img_026.jpg"), |
60 | | - join(CAM_DIR, "boards", "tmp_raw_img_027.jpg"), |
61 | | - join(CAM_DIR, "boards", "tmp_raw_img_028.jpg"), |
62 | | - join(CAM_DIR, "boards", "tmp_raw_img_029.jpg"), |
63 | | - join(CAM_DIR, "boards", "tmp_raw_img_030.jpg"), |
64 | 56 | ) |
65 | 57 |
|
66 | 58 |
|
@@ -127,7 +119,7 @@ def test_lens_calibration_abort(datafiles): |
127 | 119 | # logging.error(timeout_msg) |
128 | 120 | # raise |
129 | 121 | logging.info( |
130 | | - "Joined the lens calibratior stuff - ret %s, is_alive %s", ret, b.is_alive() |
| 122 | + "Joined the lens calibratior stuff - ret, is_alive %s", b.is_alive() |
131 | 123 | ) |
132 | 124 |
|
133 | 125 |
|
|
0 commit comments