(pixels, limit)
| 212 | detected_widths = [] |
| 213 | |
| 214 | def scan_line(pixels, limit): |
| 215 | if len(pixels) < limit + 1: |
| 216 | return None |
| 217 | diffs = np.abs(np.diff(pixels[:limit+2].astype(int))) |
| 218 | threshold = 35 # 提高阈值,减少误检(原值20太敏感) |
| 219 | candidates = np.where(diffs > threshold)[0] |
| 220 | if len(candidates) > 0: |
| 221 | return candidates[0] + 1 |
| 222 | return None |
| 223 | |
| 224 | num_samples = 5 |
| 225 |
no outgoing calls
no test coverage detected