Skip to content
5 min read

Why we stopped tracking steel bars to count them

The textbook detect-track-count pipeline undercounted rebar. A forty-year-old idea from traffic engineering fixed it.

The usual recipe for counting objects in video is well known: detect each object, give it an identity with a tracker, and count identities that cross a line. It works for cars and people. On a line of steel bars moving past a checkpoint, it quietly undercounted.

Where the recipe breaks

Counting by tracking depends on the tracker keeping exactly one identity per object. Bars that sit close together, especially at a panel seam, would merge into a single track for a few ambiguous frames. One identity lost is one bar missing from the dispatch count, and no amount of threshold tuning made it go away.

What we did instead

We borrowed from the inductive loop counters buried under roads. Instead of following each bar, we watch a narrow band of pixels at the checkpoint and count each rise-then-fall of brightness above a self-calibrating threshold. A threshold crossing has no identity to lose.

  • The count no longer depends on a tracker.
  • It works with zero labelled training data.
  • A detector still runs, but only to draw boxes for visual QA.

Handheld footage and bouncing bars

A second site filmed bars stacked horizontally with a handheld camera behind a wire fence. Bars settled and bounced across the line. Measuring motion failed, because the camera’s own pan was larger than any bar movement. What worked was comparing state within a single frame: at the instant the line fires, is the bar’s body above or below it? Only upward crossings count, and rejected crossings stay visible so every number can be checked.

Pick the method that survives your line, not the one in the tutorial.

Have a project in mind? Let’s talk about it.

Tell us what you want to build. A senior team member replies within one working day.