ampy.processing
Module provides the processing of experimental video recordings and identifies ArUco markers placed on the robots’ upper surfaces
- class ampy.processing.Processor
processing.Processor class provides interface for processing of experiment videos
- cartesian_kinematics(bots_number: int, begin_frame: int, end_frame: int, get_each: int, ignore_codes: tuple, scale_parameters: tuple) list
Returns cartesian kinematics for particles in video with given processing parameters
- Parameters:
bots_number – number of bots in video
begin_frame – frame to begin the processing
end_frame – frame to end the processing
get_each – frames decimation frequency
ignore_codes – markers to ignore while recognition
scale_parameters – pixels absolute scaling parameters
- Returns:
list of frame-by-frame particles cartesian kinematic
- field_center_auto(first_line_markers: tuple, second_line_markers: tuple, scale_parameters: tuple) tuple
Return center of the field calculated as the intersection of two lines which were defined by two pairs of markers
- Parameters:
first_line_markers – markers IDs to define the first line
second_line_markers – markers IDs to define the second line
scale_parameters – pixels absolute scaling parameters
- Returns:
field’s center
- field_center_manual() tuple
Shows the video’s first frame and returns clicked point coordinates
- Returns:
clicked point coordinates
- static load_p(filename) list
Load system’s kinematics serialized by pickle :param filename: path to .pickle file :return: system’s kinematics
- metric_constant(marker_size: float, scale_parameters: tuple) float
Returns factor that scale distances in pixel on video to distances in centimeters
- Parameters:
marker_size – used ArUco marker size in centimeters
scale_parameters – pixels absolute scaling parameters
- Returns:
scaling factor
- static polar_kinematics(cartesian_kinematics: list, field_center: tuple) list
Returns kinematics extended by a polar angle (from 0 to 360 degrees clockwise in relation to X-axis) and a distance from field center for each particle
- Parameters:
cartesian_kinematics – cartesian kinematics of a system
field_center – a center of a polar coordinates
- Returns:
polar system’s kinematics