MCPcopy Create free account
hub / github.com/VitoHowe/glm-coding / bbox_from_mask

Function bbox_from_mask

app/services/tenvision_adapter.py:144–152  ·  view source on GitHub ↗
(mask)

Source from the content-addressed store, hash-verified

142 x2 = int(xs.max()) + 1
143 y1 = int(ys.min())
144 y2 = int(ys.max()) + 1
145 return x1, y1, x2 - x1, y2 - y1
146
147
148def smooth_projection(values, window=5):
149 if values.size < window or window <= 1:
150 return values.astype(np.float32)
151 kernel = np.ones(window, dtype=np.float32) / window
152 return np.convolve(values.astype(np.float32), kernel, mode='same')
153
154
155def contiguous_runs(flags):

Callers 2

split_mask_to_boxesFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected