(mask)
| 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 | |
| 148 | def 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 | |
| 155 | def contiguous_runs(flags): |
no outgoing calls
no test coverage detected