entry_exit_mouse_box.media_manager module

class entry_exit_mouse_box.media_manager.MediaManager(viewer)[source]

Bases: object

add_source(file_path, target_layer, img_type, process=None)[source]

Add a new video source to the manager.

Parameters:
  • file_path – Path of the video file to be opened.

  • target_layer – Name of the layer to which each frame of the video will be loaded.

  • img_type – Type of the image to be loaded (‘image’ or ‘labels’).

  • process – Function to be applied to each frame of the video before displaying it.

Raises:
  • FileNotFoundError – If the file is not found at the specified path.

  • IOError – If the file cannot be opened.

  • ValueError – If the properties of the video do not match the properties of the media already opened.

Returns:

The properties of the last video added under the form of a dictionary.

get_current_frame_number()[source]
get_fps()[source]
get_height()[source]
get_n_frames()[source]
get_n_sources()[source]
get_source_by_index(index)[source]
get_source_by_name(name)[source]
get_video_properties()[source]
get_width()[source]
release()[source]
release_source(index)[source]
set_frame(frame_target)[source]
set_logger(logger)[source]
entry_exit_mouse_box.media_manager.properties_match(p1, p2)[source]