PREVIEW · mockup, not the final build
// SIDE QUEST · MACHINE VISION

Counting Station

Hardware shops still count nuts and bolts by hand, one at a time. Counting Station lets a shopkeeper tip a handful onto a sheet of paper and get the count from a phone camera, and it speaks up when it isn't sure.

CLASSICAL COMPUTER VISIONARUCO CALIBRATIONWATERSHEDYOLO11N-OBBRUNS ON A LAPTOP CPU
// THE SETUP

A phone and a printed sheet of paper.

No scale, no special machine, no training data. The mat is an ordinary A4 sheet with four printed markers in its corners. The camera can be held at any angle: the markers flatten the photo into a top-down view and turn pixels into millimetres.

That one trick does most of the work. Once everything is measured in real units, the size of one screw is a physical fact rather than a guess, and a blob twice that size is two screws.

// HOW IT COUNTS

Five steps, and every one is visible.

01

Flatten

Find the markers (three are enough if a hand covers one) and warp the photo onto the mat.

02

Check how dark the parts are

Black parts and shiny steel need opposite treatment, so it measures first and picks the right method.

03

Separate parts from the mat

Dark parts: keep only their near-black core, so shadows and grease drop out. Bright parts: keep anything with crisp edges, so glare doesn't break them up.

04

Count every blob twice

Once by area against the size of one part, once by splitting clumps along their narrow necks. The two answers are reconciled.

05

Say how sure it is

Every count comes with a range. When a clump is unclear it says so, shows where, and asks you to spread the parts.

+

Teach a part once

Lay a few loose pieces down once and it learns that part's exact size, which removes most remaining errors.

// LOOK INSIDE

Every stage, on one sheet.

For each photo the station can lay out every intermediate image side by side, so when a count is wrong you can see exactly which step went wrong instead of guessing. Here, 8 shiny steel screws on the mat.

Four processing steps for 8 steel screws: lighting evened out, parts separated from the mat, specks removed, counted 8
scroll sideways to see the whole sheet →
8 steel screws, left to right: the lighting evened out, everything that stands out from the mat, specks removed and holes filled, then the count: 8. Green is one screw; orange is a crossed pair, counted as two.
// HARSH LIGHT

Shadows aren't parts.

A desk lamp throws hard shadows, and a simple threshold glues each part to its shadow and its neighbours. The final version divides every pixel by how bright the paper around it should be, so paper, shadow and metal separate cleanly, and only the near-black core of each part is kept.

Washers under a harsh shadow: original photo, the earlier method's merged orange mask counting 51, and the final method's separate green masks counting 54
scroll sideways to compare →
Washers with a harsh shadow added, about 55 by eye. The earlier method (orange) merges shadows into big blobs and counts 51. The final method (green) ignores the shadows and counts 54.
// A SECOND OPINION

Two methods that check each other.

Alongside the classical pipeline sits a small learned detector, YOLO11n-OBB. Nobody drew a single box for it: it learned from thousands of synthetic scenes built by cutting real screws out of a handful of photos and pasting them onto empty mats, with fake shadows, glare and blur.

Each is strong exactly where the other is weak: counting by area handles tight clusters of small screws, the detector handles long screws lying across each other. So when they agree, the count can be trusted, and when they don't, the station asks for the parts to be spread out before it commits.

// RESULTS

Measured on real photos.

100%

Of counts were correct whenever the two methods agreed, so agreement is a trust signal you can act on

±1

The most it was ever off on a handful of screws, once it had been shown the part a single time

0.83 s

Per photo on one laptop CPU core, no GPU needed

Every number regenerates from a frozen, checksummed snapshot of the code and data.