sksurgeryarucotracker.algorithms.rigid_bodies module

Classes and functions for maintaining ArUco rigid bodies

class sksurgeryarucotracker.algorithms.rigid_bodies.ArUcoRigidBody(rigid_body_name)[source]

Bases: object

Class to handle the loading and registering of ArUco Rigid Bodies

add_single_tag(tag_size, marker_id, dictionary)[source]

We can use this to track single ArUco tags rather than patterns as long as we know the tag size in mm

Param:tag size in mm
Param:marker id/_
get_dictionary_name()[source]

returns the name of the aruco dictionary in use

get_pose(camera_projection_matrix, camera_distortion)[source]

Estimate the pose of the rigid body, with or without camera calibration

Param:camera_projection_matrix 3x3 projection matrix. If None we estimate pose based on pattern size
Param:1x5 camera distortion vector
load_3d_points(filename, dictionaryname)[source]

Loads the 3D point geometry from a file

Parameters:filename – Path of file containing tag data
reset_2d_points()[source]

Clears 2D point lists.

scale_3d_tags(measured_pattern_width)[source]

We can scale the tag, which is very useful if you’ve got the tag on your mobile phone.

Parameters:measured_pattern_width – Width of the tag in mm
set_2d_points(two_d_points, tag_ids)[source]

takes a list of 2 points, and if the id’s match 3D points, assigns them to a list of 2d points

Parameters:
  • two_d_points – array of marker corners, 4 for each tag
  • tag_ids – id for each tag
Returns:

tag ids for any assigned tags

class sksurgeryarucotracker.algorithms.rigid_bodies.Board(markerpoints, dictionary, marker_ids)[source]

Bases: object

A local replacement for aruco.Board which was deprecated at 4.7

class sksurgeryarucotracker.algorithms.rigid_bodies.TwoDTags[source]

Bases: object

Stores two linked arrays, on of tag IDs and the other 2D points

append_tag(tag_id, points)[source]

Adds a tag to the two point list :param tag_id: The id of the tag :param points: 4 points defining the tag corners

sksurgeryarucotracker.algorithms.rigid_bodies.configure_rigid_bodies(configuration)[source]

reads configuration and creates a list of rigid bodies together with a list of dictionaries used.

sksurgeryarucotracker.algorithms.rigid_bodies.load_board_from_file(filename, dictionary=16)[source]

loads marker pattern from filename. :return: an aruco.board :raise ValueError: If the file does not have 16 or 13 columns

sksurgeryarucotracker.algorithms.rigid_bodies.scale_tags(board, measured_pattern_width)[source]

We can scale the tag on a board, which is very useful if you’ve got the tag on your mobile phone.

Param:the board to scale
Parameters:measured_pattern_width – Width of the tag in mm
sksurgeryarucotracker.algorithms.rigid_bodies.single_tag_board(tag_size, marker_id, dictionary=< cv2.aruco.Dictionary 0x7efc05e71d30>)[source]

Create a board consisting of a single ArUco tag

Param:tag size in mm
Param:marker id
Param:dictionary to use