utils2p/synchronization.py
def _capture_metadata(n_frames, dropped_frames=None):
    """
    Returns a dictionary as it is usually saved by the seven
    camera setup in the "capture_metadata.json" file.
    It assumes that no frames where dropped.

    Parameters
    ----------
    n_frames : list of integers
        Number of frames for each camera.
    dropped_frames : list of list of integers
        Frames that were dropped for each camera.
        Default is None which means no frames where
        dropped.

    Returns
    -------
    capture_info : dict
        Default metadata dictionary for the seven camera
        system.
    """
    if dropped_frames is None:
        dropped_frames = [[] for i in range(len(n_frames))]
    capture_info = {"Frame Counts": {}}
    for cam_idx, n in enumerate(n_frames):
        frames_dict = {}
        current_frame = 0
        for i in range(n):
            while current_frame in dropped_frames[cam_idx]:
                current_frame += 1
            frames_dict[str(i)] = current_frame
            current_frame += 1
        capture_info["Frame Counts"][str(cam_idx)] = frames_dict
    return capture_info

    Returns a dictionary as it is usually saved by the seven
    camera setup in the "capture_metadata.json" file.
    It assumes that no frames where dropped.

    Parameters
    ----------
    n_frames : list of integers
        Number of frames for each camera.
    dropped_frames : list of list of integers
        Frames that were dropped for each camera.
        Default is None which means no frames where
        dropped.

    Returns
    -------
    capture_info : dict
        Default metadata dictionary for the seven camera
        system.
    
Returns a dictionary as it is usually saved by the seven
camera setup in the "capture_metadata.json" file.
It assumes that no frames where dropped.

Parameters

n_frames : list of integers
Number of frames for each camera.
dropped_frames : list of list of integers
Frames that were dropped for each camera.
Default is None which means no frames where
dropped.

Returns

capture_info : dict
Default metadata dictionary for the seven camera
system.
Returns a dictionary as it is usually saved by the seven camera setup in the " capture_metadata . json " file . It assumes that no frames where dropped . Parameters n_frames : list of integers Number of frames for each camera . dropped_frames : list of list of integers Frames that were dropped for each camera . Default is None which means no frames where dropped . Returns capture_info : dict Default metadata dictionary for the seven camera system .
def _capture_metadata(n_frames, dropped_frames=None):
    if dropped_frames is None:
        dropped_frames = [[] for i in range(len(n_frames))]
    capture_info = {"Frame Counts": {}}
    for cam_idx, n in enumerate(n_frames):
        frames_dict = {}
        current_frame = 0
        for i in range(n):
            while current_frame in dropped_frames[cam_idx]:
                current_frame += 1
            frames_dict[str(i)] = current_frame
            current_frame += 1
        capture_info["Frame Counts"][str(cam_idx)] = frames_dict
    return capture_info
def _capture_metadata ( n_frames , dropped_frames = None ) : if dropped_frames is None : dropped_frames = [ [ ] for i in range ( len ( n_frames ) ) ] capture_info = { "Frame Counts" : { } } for cam_idx , n in enumerate ( n_frames ) : frames_dict = { } current_frame = 0 for i in range ( n ) : while current_frame in dropped_frames [ cam_idx ] : current_frame += 1 frames_dict [ str ( i ) ] = current_frame current_frame += 1 capture_info [ "Frame Counts" ] [ str ( cam_idx ) ] = frames_dict return capture_info
Returns a dictionary as it is usually saved by the seven
camera setup in the "capture_metadata.json" file.
Returns a dictionary as it is usually saved by the seven camera setup in the " capture_metadata . json " file .
"""
    Returns a dictionary as it is usually saved by the seven
    camera setup in the "capture_metadata.json" file.
    It assumes that no frames where dropped.

    Parameters
    ----------
    n_frames : list of integers
        Number of frames for each camera.
    dropped_frames : list of list of integers
        Frames that were dropped for each camera.
        Default is None which means no frames where
        dropped.

    Returns
    -------
    capture_info : dict
        Default metadata dictionary for the seven camera
        system.
    """
n_frames
dropped_frames