reparo.order

reparo.order.chain_frames(dist_matrix, first_frame=0, valid_idxs=None)[source]

Chain together frames that are similar

Parameters
  • dist_matrix (numpy.ndarray[N, N]) – frame codistance matrix

  • first_frame (int, optional) – index of the first frame

  • valid_idxs (list<int>, optional) – list of valid frame indices

Returns

ordered frame indices

Return type

list<int>

reparo.order.get_chain_split(used_frames, dist_matrix)[source]

Filter noisy frames out

Parameters
  • used_frames (list<int>) – ordered frame indices

  • dist_matrix (numpy.ndarray[N, N]) – frame codistance matrix

Returns

pair of frame indices around the sequence split

Return type

tuple<int, int>

reparo.order.reorder_frames(frames, metric='cosine', target_size=(128, 128), denoise=False)[source]

Reorder frames in a coherent fashion

Parameters
  • frames (list<numpy.ndarray[H, W, 3]>) – video frames

  • metric (str, optional) – matrix used for codistance matrix

  • target_size (tuple<int, int>, optional) – frame size used for codistance computation

  • denoise (bool, optional) – whether the frames need to be denoised

Returns

video frames

Return type

list<numpy.ndarray[H, W, 3]>