The sequence module contains functions related to sequence, trajectory and region. The toolkit defines a region as a description of a set of pixels in an image frame, a trajectory as a list of regions that can either describe groundtruth annotations or tracker result, and a sequence as a combination of a list of images, their corresponding groundtruth annotations and additional metadata.
Each sequence is described using a sequence descriptor structure. The structure contains the following fields:
-
name (string): Sequence name string.
-
directory (string): The directory path where images of the sequence are located.
-
mask (string): Sequence name string.
-
length (integer): Number of frames in the sequence
-
file (string): Name of the groundtruth annotations file.
-
images (cell): Cell array of strings that represent names of image files.
-
groundtruth (cell): Cell array of matrices that represent region annotations.
-
width (integer): Width of images in the sequence.
-
height (integer): Height of images in the sequence.
-
channels (integer): Number of color channels in the sequence.
-
grayscale (boolean): True if the sequence is grayscale.
-
tags (structure): Contains per-frame tag data.
- names (cell): Cell array of tag names.
- data (boolean): A boolean matrix where each column denotes per-frame tag presence for a corresponding name in the names field.
-
values (structure): Contains per-frame value data.
- names (cell): Cell array of value names.
- data (double): A double matrix where each column denotes per-frame value for a corresponding name in the names field.
-
properties (structure): Additional sequence metadata.
-
initialize (function): Function handle that is used to create initialization region for the tracker. By default the function simply returns groundtruth annotation for the given frame.
Most of the values in the descriptor are determined from the content of the sequence directory.
The stored output of the tracker (the final combined trajectory) is encoded as
text file where a region for each frame is encoded as comma-separated list.
The absolute coordinates of a region have an origin in the top-left corner of the
image with coordinates 0,0
. Currently there are three types of region formats
that are supported by the system.
- Rectangle - Specified by four values:
left
,top
,width
, andheight
. - Polygon - Specified by even number of at least six values that define points in the polygon (
x
andy
coordinates). - Special: This stored sequence describes the entire tracking trial process
with failures and re-initializations encoded between regular frames
in a special format that is specified by a single value. This value can
have a special meaning. Initialization of the tracker is denoted
by
1
, failure of the tracker is denoted by2
and undefined state (e.g. due to frame skipping) is denoted by0
.
- sequence_create - Create a new sequence descriptor
- sequence_load - Load a set of sequences
- convert_sequences - Converts sequences using a converter
- sequence_grayscale - Returns grayscale sequence
- sequence_pixelchange - Returns sequence with arbitrary pixel transformation
- sequence_resize - Returns resized sequence
- sequence_reverse - Returns a reversed sequence
- sequence_skipping - Returns sequence with skipped frames
- sequence_transform_initialization - Returns sequence with transformed initialization
- sequence_fragment - Returns an array of subsequences
- sequence_get_image - Returns image paths for the given sequence
- sequence_get_region - Returns region, or multiple regions for the given sequence
- sequence_get_frame_value - Returns frame values for the given sequence
- sequence_get_tags - Returns all tags for a given frame
- sequence_query_tag - Find tag occurences in a sequence
- sequence_find - Find a sequence by its name
These functions are used to maniputate visualization information for sequences.
- sequence_visualize - Interactive sequence visualization
- sequence_select - Select sequence from a list interactively
- calculate_overlap - Calculates overlap for two trajectories
- write_trajectory - A MEX function that writes trajectory to a file
- read_trajectory - A MEX function that reads trajectory from a file
- region_draw - Draw a region on the current figure
- region_offset - Translates the region
- region_overlap - A MEX function that calculates the overlap between two regions
- region_convert - A MEX function that converts between different region formats
- region_mask - A MEX function that converts a region to a binary mask