MCPcopy Create free account
hub / github.com/ComputationalRobotics/XM-code / delete_thereshold

Function delete_thereshold

2_test_creatematrix.py:74–83  ·  view source on GitHub ↗
(min_threshold, M, data)

Source from the content-addressed store, hash-verified

72M = int(np.max(edges[:, 1]))
73
74def delete_thereshold(min_threshold, M, data):
75 valid_frames = np.bincount(data, minlength=M)
76 valid_indices = valid_frames > min_threshold
77 wrong_indices = valid_frames <= min_threshold
78 num_valid_frames = np.sum(valid_indices)
79 frame_index = np.zeros(M, dtype=int)
80 frame_index[valid_indices] = np.arange(num_valid_frames)
81 frame_index[wrong_indices] = -1
82 max_frame = np.argmax(valid_frames)
83 return max_frame, num_valid_frames, frame_index
84
85# delete and reindex the frames that contains zero landmarks
86max_frame, N, indices_frame = delete_thereshold(0, N, edges[:,0]-1)

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected