Utility function for _contour_trace Contours with an area of the order as 1 pixel are considered spurious.
(x, y)
| 259 | |
| 260 | |
| 261 | def _is_invalid_contour(x, y): |
| 262 | """ |
| 263 | Utility function for _contour_trace |
| 264 | |
| 265 | Contours with an area of the order as 1 pixel are considered spurious. |
| 266 | """ |
| 267 | too_small = np.all(np.abs(x - x[0]) < 2) and np.all(np.abs(y - y[0]) < 2) |
| 268 | return too_small |
| 269 | |
| 270 | |
| 271 | def _extract_contours(im, values, colors): |