nicetoolbox.detectors.feature_detectors.proximity.utils

Utility functions for visualizing proximity scores.

Functions

frame_with_linegraph

Combines a video frame with line graphs representing proximity scores up to the current frame.

visualize_proximity_score

Visualizes the proximity score for a given data array and saves the plots as images.

nicetoolbox.detectors.feature_detectors.proximity.utils.frame_with_linegraph(frame, data, current_frame, global_min, global_max)[source]

Combines a video frame with line graphs representing proximity scores up to the current frame.

Parameters:
  • frame (numpy.ndarray) – The video frame to be combined with the line graphs.

  • data (list) – The list of data arrays containing proximity scores.

  • current_frame (int) – The current frame index.

  • global_min (float) – The minimum value for the y-axis of the line graphs.

  • global_max (float) – The maximum value for the y-axis of the line graphs.

Returns:

The combined image of the frame and line graphs.

Return type:

numpy.ndarray

nicetoolbox.detectors.feature_detectors.proximity.utils.visualize_proximity_score(data, output_folder, keypoint, camera_names=None)[source]

Visualizes the proximity score for a given data array and saves the plots as images.

Images are created for each camera. If the number of keypoints is greater than 1, the proximity score is visualized for the center of the selected keypoints.

Parameters:
  • data (numpy.ndarray) – The data array containing proximity scores.

  • output_folder (str) – The path to the output folder where the images will be saved.

  • keypoint (str or list) – The name(s) of the keypoint(s) used for calculating proximity scores.

  • camera_names (list, optional) – The names of the cameras. Defaults to None.

Returns:

None