Classical Machine Learning
Count connected seed regions
Allow diagonal neighbours
Botie has foreground pixels and needs connected regions. Whether touching corners count as connections changes the answer even when the mask stays fixed.
BOTIE
The inputs we are comparing
Seed foreground mask
Same in both cases
| 1 | 0 | 0 |
| 0 | 1 | 0 |
| 0 | 0 | 1 |
Neighbour rule: 4 or 8
Diagonal pixels, shared edges only
4
Diagonal pixels, corners allowed
8
Result for diagonal pixels, shared edges only
3
For a list use brackets, such as [2, 4]. For a matrix put each row in brackets. Text answers can stay as text.
One diagonal bridge and one separate seed
This check uses the pieces from “Label reachable foreground and count its IDs”.
BOTIE
- Seed foreground mask
1 0 1 1 0 0 0 1 0 - Neighbour rule: 4 or 8
8
Use a number, text, or an array matching the requested result. For a matrix, put each row in brackets. Saving your prediction runs your current construction on these inputs and checks the earlier examples too.
Build a construction in the workspace above first. This case will test those pieces.
Why is the neighbour rule part of the reported result, and why might one connected region still contain more than one physical seed?
A connected component is defined by a mask and a connectivity convention, not by guaranteed physical object identity.
Connected regions are not necessarily physical objects. Touching seeds can merge, and a fragmented seed can split.
Work through the Python challenges →