RoboSkillHub
Catalog / Skills
skill

segmenting-and-picking-pieces-classical

Finds the loose jigsaw pieces lying on a staging mat in one top-down RGB(-D) frame without a learned model - removes the mat by its colour (estimated from the frame, shadow-tolerant, or a fixed HSV band) and by height when the depth is fine, sorts the blobs by area and shape into pieces, touching or stacked pieces and foreign objects, splits touching pieces with a distance-transform watershed that follows the dark cut line, and gives every piece its mask, a pick point at the centre of its largest inscribed circle lifted to the world, its side angle, area, touching neighbours, a two-finger grip check and a face-up / face-down cue. Routes segmented, touching_pieces or nothing_found. Use before picking a jigsaw piece from a staging area (and before localizing it in the box picture), on CPU, in a fraction of a second; sam3 is the learned alternative when a GPU is available.

Kind
Skill · perceive: finds and measures things in the scene
Robots
any robot
Tasks
jigsaw
Takes
observation Observation
Gives
n_pieces int, n_touching int, n_pickable int, piece_mask Mask, pick_point Vec3, angle_deg float
Calls
geometry
License
MIT
Source
source on GitHub · SKILL.md · upstream code · v0.1.0

Exits

What the skill reports when it ends; a policy branches on these.

segmented At least one piece was found and none touches anything; `pieces` lists them, piece_mask / pick_point are the best pickable one (clearest of its surroundings, then the widest inscribed circle).
touching_pieces Pieces were found but some touch or lie on one another (split by the watershed or by height; their records say touching, neighbours, layer), or a blob did not split into piece-sized parts (`clusters`, with the source's drag point and direction); piece_mask / pick_point still name the best pickable piece when n_pickable > 0. Singulate the rest, e.g. singulating-by-pushing toward `free_spot`.
nothing_found No piece-sized blob on the mat (empty, or only foreign objects and specks).

Scripts

segment_pieces

Use it

Take this bundle (and the tools it calls) into a registry for your task, then point your policy generator at it:

git clone https://github.com/runtime-si/RoboSkillHub
cd RoboSkillHub && uv sync
uv run --no-sync roboskillhub search "finds the loose jigsaw pieces lying on a staging mat in…" --why
uv run --no-sync roboskillhub view --bundles segmenting-and-picking-pieces-classical --out my_registry

See Get started for searching by task and robot, locking what a policy uses, and fetching it on the robot.