ir_plane_tracker
¶
pupil_labs.ir_plane_tracker package.
A tool for tracking planes marked with markers.
Modules:
-
tracker–
Classes:
-
PlaneLocalization–Result of plane localization.
-
Tracker–A Tracker for tracking planes marked with markers.
-
TrackerParams–Parameters for the IR plane tracker.
PlaneLocalization
dataclass
¶
PlaneLocalization(corners: NDArray[float64], img2plane: NDArray[float64], plane2img: NDArray[float64], reprojection_error: float)
Result of plane localization.
Attributes:
-
corners(NDArray[float64]) –Corners of the plane in image coordinates.
-
img2plane(NDArray[float64]) –Transformation matrix from image to plane coordinates.
-
plane2img(NDArray[float64]) –Transformation matrix from plane to image coordinates.
-
reprojection_error(float) –Reprojection error of the localization in pixels.
Tracker
¶
Tracker(camera_matrix: NDArray[float64], dist_coeffs: NDArray[float64], params: TrackerParams | None = None)
A Tracker for tracking planes marked with markers.
Parameters:
-
camera_matrix(NDArray[float64]) –Camera intrinsic matrix.
-
dist_coeffs(NDArray[float64]) –Camera distortion coefficients.
-
params(TrackerParams | None, default:None) –Tracker parameters. If None, default parameters are used.
Methods:
-
__call__–Tracks the plane in the given image.
Source code in src/pupil_labs/ir_plane_tracker/tracker.py
873 874 875 876 877 878 879 880 881 882 883 884 885 886 887 888 889 890 891 892 893 894 | |
__call__
¶
__call__(image: NDArray[uint8]) -> PlaneLocalization | None
Tracks the plane in the given image.
Parameters:
-
image(NDArray[uint8]) –Input image.
Returns:
-
PlaneLocalization | None–PlaneLocalization if the plane is found, None otherwise.
Source code in src/pupil_labs/ir_plane_tracker/tracker.py
1268 1269 1270 1271 1272 1273 1274 1275 1276 1277 1278 1279 1280 1281 1282 1283 1284 1285 1286 1287 1288 1289 1290 1291 1292 1293 1294 1295 1296 1297 1298 1299 1300 1301 1302 1303 1304 1305 1306 1307 1308 1309 1310 1311 1312 1313 1314 1315 | |
TrackerParams
dataclass
¶
TrackerParams(plane_width: float = nan, plane_height: float = nan, top_pos: tuple[float, float] = (nan, nan), bottom_pos: tuple[float, float] = (nan, nan), right_pos: tuple[float, float] = (nan, nan), left_pos: tuple[float, float] = (nan, nan), feature_point_positions_mm: NDArray[float64] = lambda: array([0.0, 6.0, 8.0, 10.0])(), padding_mm: float = 5.0, circle_diameter_mm: float = 6.0, line_thickness_mm: float = 3.0, img_size_factor: float = 1.0, thresh_c: int = 45, thresh_half_kernel_size: int = 20, min_contour_area_line: int = 70, max_contour_area_line: int = 360, min_contour_area_ellipse: int = 12, max_contour_area_ellipse: int = 70, min_line_contour_count: int = 3, min_ellipse_contour_count: int = 6, min_contour_support: int = 6, fragments_min_length: float = 30.0, fragments_max_length: float = 70.0, fragments_max_projection_error: float = 5.0, min_line_fragments_count: int = 3, min_ellipse_size: int = 4, max_ellipse_aspect_ratio: float = 2.0, min_ellipse_count: int = 8, max_cr_error: float = 0.12, max_feature_line_length: float = 150.0, min_feature_line_count: int = 3, feature_line_max_projection_error: float = 2.0, optimization_error_threshold: float = 15.0, debug: bool = False)
Parameters for the IR plane tracker.
Attributes:
-
bottom_pos(tuple[float, float]) –Position of the bottom marker in mm.
-
left_pos(tuple[float, float]) –Position of the left marker in mm.
-
plane_height(float) –Height of the tracked plane in mm.
-
plane_width(float) –Width of the tracked plane in mm.
-
right_pos(tuple[float, float]) –Position of the right marker in mm.
-
top_pos(tuple[float, float]) –Position of the top marker in mm.
bottom_pos
class-attribute
instance-attribute
¶
Position of the bottom marker in mm.
left_pos
class-attribute
instance-attribute
¶
Position of the left marker in mm.
plane_height
class-attribute
instance-attribute
¶
plane_height: float = nan
Height of the tracked plane in mm.
plane_width
class-attribute
instance-attribute
¶
plane_width: float = nan
Width of the tracked plane in mm.
right_pos
class-attribute
instance-attribute
¶
Position of the right marker in mm.