ListOfBlobs#
Warning
The code reference is a work in progress and may contain inconsistencies.
- class idtrackerai.ListOfBlobs(blobs_in_video: list[list[Blob]])[source]#
Contains all the instances of the class
Blob.- blobs_in_video: list[list[Blob]]#
Main and only attribute of the class, it contains a list of all
Blobinstances in a frame for every frame in the video
- classmethod load(file_path: Path | str, verbose: bool = True) ListOfBlobs[source]#
Loads an instance of a class saved in a .pickle file.
- Parameters:
file_path (Path | str) – Path to a saved instance of a ListOfBlobs object
- Return type:
- save(file_path: Path | str) None[source]#
Saves instance of the class with Python’s pickle protocol
- Parameters:
file_path (Path | str) – Path where to save the object
- property number_of_blobs: int#
Total number of Blobs in self
- property number_of_frames: int#
Number of frames in the video, equal to the number of lists of Blobs in self
- compute_overlapping_between_subsequent_frames() None[source]#
Computes overlapping between blobs in consecutive frames.
Two blobs in consecutive frames overlap if the intersection of the list of pixels of both blobs is not empty.
See also
- set_images_for_identification(episodes: list[Episode], id_images_files: list[Path], id_image_size: list[int], resolution_reduction: float, n_jobs: int) None[source]#
Computes and saves the images used to classify blobs as crossings and individuals and to identify the animals along the video.
- add_blob(frame_number: int, centroid: tuple, identity: int)[source]#
[Validation] Adds a Blob object the frame number.
Adds a Blob object to a given frame_number with a given centroid and identity. Note that this Blob won’t have most of the features (e.g. area, contour, fragment_identifier, bbox, …). It is only intended to be used for validation and correction of trajectories. The new blobs generated are considered to be individuals.
- Parameters:
frame_number (int) – Frame in which the new blob will be added
centroid (tuple) – The centroid of the new blob
identity (int) – Identity of the new blob
- property max_number_of_blobs_in_one_frame#
Max number of blobs in one frame
Deprecated since version 6.0.0: Use max(map(len, ListOfBlobs.blobs_in_video)) instead
- load_from_v4()[source]#
Load from v4
Deprecated since version 6.0.0: Loading ListOfBlobs from v4 is not supported anymore