Dev Log: Bringing Surveillance DORI Math into the Browser
2026-06-24
dev-logengineeringbuilding-in-publicsurveillance
This is the second post in the LocalPapa Notes dev-log series. Last time we covered the earliest tool in our history, PDF to Markdown. Moving forward along the timeline, the next tool is the DORI Surveillance Calculator.
What DORI is, and why anyone needs to compute it
If you've ever planned a CCTV system, you've probably heard of DORI. It's the international standard for surveillance camera performance (EN 62676-4), describing how clearly a camera "sees" at a given distance using PPM (Pixels Per Meter), in four tiers:
- Detection (~25 PPM): is there a person there?
- Observation (~63 PPM): what are they doing?
- Recognition (~125 PPM): do I recognise this person?
- Identification (~250 PPM): who exactly is this?
Here's the catch: which tier a camera achieves changes with distance. The same camera that can identify a face at 3 metres might only manage detection at 30 metres — you know something's moving, and that's it.
When laying out cameras, security engineers have to apply the formula over and over, for every lens and every distance, to confirm "can we still recognise a face at this range?" It's tedious and error-prone.
The core: one formula, but it has to be instant and intuitive
The conversion itself isn't hard. It comes down to one formula:
PPM = (resolution width × focal length) / (sensor width × distance)
And inversely, to find the maximum effective distance for a target PPM:
Max distance (m) = (resolution width × focal length) / (sensor width × target PPM)
The hard part isn't the maths — it's the interaction. What an engineer actually wants is to nudge the focal length or swap the resolution and watch the four limit distances (D, O, R, I) update immediately — not to press a "Calculate" button and stare at a frozen number.
How we did it
- Live computation, no submit button. Every input field and dropdown gets a real-time listener; the moment any parameter changes, all four D / O / R / I distances recompute. The three-step "fill form → submit → read result" collapses into a single "tweak and watch."
- Common specs as presets. Focal lengths, sensor sizes and resolutions have standard industry values, so we put them in dropdown presets — no re-typing every time.
- Consistent precision. All distances round to one decimal place — for on-site planning, 0.1 m is precise enough without spitting out a string of fake-precise decimals.
- Bundled explanation. The tool includes an explainer of the four DORI tiers, so even people unfamiliar with the standard understand what "125 PPM" actually means.
And of course, the whole calculation runs locally in your browser — no need to upload any site plans or equipment lists.
A small architectural decision
This tool used the platform's lazy-load architecture: the main app only fetches a tool's dedicated logic and styles when the user actually opens it.
Why? Because LocalPapa is a village of dozens of tools. If every tool's code loaded on the homepage at once, the homepage would get heavier and slower over time. Lazy-loading keeps the homepage opening instantly while each tool stays independent and doesn't drag the others down. That principle stuck around.
What we learned
- "Can compute" and "pleasant to use" are different things. Anyone can look up a formula; the real time-saving is turning it into a zero-wait, tweak-and-watch interface.
- Presets are a form of thoughtfulness. Baking common industry specs into dropdowns embeds domain knowledge into the tool and lowers the barrier to entry.
- Local computation isn't only about privacy — it's about speed. Without the round-trip to a server, "updates instantly as you type" is even possible.
The same question, again
Like the first post in the series, this tool answers the same question: can something that used to require manual work — or handing it to some online service — be done entirely in the browser, instantly?
For DORI, the answer was, once again: yes.
In the next dev log, we move on to expanding the PDF suite — rotate, PDF-to-image, unlock. Want to follow the series? Bookmark LocalPapa Notes.