scikit-surgeryarucotracker

ARuCo Tracking

A class for straightforward tracking with an ARuCo

class sksurgeryarucotracker.arucotracker.ArUcoTracker(configuration)[source]

Bases: sksurgerycore.baseclasses.tracker.SKSBaseTracker

Initialises and Configures the ArUco detector

Parameters:configuration

A dictionary containing details of the tracker.

video source: defaults to 0

aruco dictionary: defaults to DICT_4X4_50

marker size: defaults to 50 mm

camera projection: defaults to None

camera distortion: defaults to None

smoothing buffer: specify a buffer over which to average the tracking, defaults to 1

rigid bodies: a list of rigid bodies to track, each body should have a ‘name’, a ‘filename’ where the tag geometry is defined, and an ‘aruco dictionary’ to use. Additionally we can include ‘tag width’ in mm when the tag has been scaled during printing or is displayed on a mobile phone screen or similar

Raises:Exception – ImportError, ValueError
close()[source]

Closes the connection to the Tracker and deletes the tracker device.

Raises:Exception – ValueError
get_frame(frame=None)[source]

Gets a frame of tracking data from the Tracker device.

Parameters:frame – an image to process, if None, we use the OpenCV video source.
Returns:port_numbers: If tools have been defined port numbers are the tool descriptions. Otherwise port numbers are the aruco tag ID prefixed with aruco

time_stamps : list of timestamps (cpu clock), one per tool

frame_numbers : list of framenumbers (tracker clock) one per tool

tracking : list of 4x4 tracking matrices, rotation and position,

tracking_quality : list the tracking quality, one per tool.

Raises:Exception – ValueError
get_tool_descriptions()[source]

Returns tool descriptions

has_capture()[source]

:Returns true if the tracker has it’s own opencv source otherwise false

start_tracking()[source]

Tells the tracking device to start tracking. :raise Exception: ValueError

stop_tracking()[source]

Tells the tracking devices to stop tracking. :raise Exception: ValueError