Measuring speed from video: what physics demands
This piece describes Brazilian law — the Brazilian traffic code (Código de Trânsito Brasileiro, CTB), the Civil Code and the general data protection act (LGPD) — and the way gated communities are run in Brazil. It is not legal advice, and it does not describe the rules in force where you live. Check your own jurisdiction before acting on any of it. The physics and the engineering standards, on the other hand, are the same everywhere.
Short answer
Speed measured from video is a known distance divided by the time between two instants. Since those are the only two ingredients, the error can only come from three places: the distance, the time, and which point on the vehicle was taken at each instant.
The time error is the treacherous one because it is invisible: it does not show up in the image. Two records of the same vehicle can look identical and still have been marked on different frames — and a single frame of difference already moves the reading materially, with nothing in the scene to give the deviation away.
In this piece
Speed from video is a division, and that is all it is
You mark out a stretch of known length — the measured gap — and record the instant the vehicle enters it and the instant it leaves. The average speed over the stretch is the length of the gap divided by the difference between the two instants.
From which follows a consequence that usually disappoints: the result is always an average over the gap, never the instantaneous speed at a point. If the driver braked halfway through, the number delivered is not the peak — and the report has to say so.
The paper presenting the ForeSpeed dataset, produced with a vehicle at known speeds, records that the accuracy of the estimate depends heavily on camera specifications, acquisition method, spatial and temporal resolution, compression and the perspective of the scene.
The error in the distance comes from three different places
- The field measurement. The gap has to be measured on the ground, with a tape measure, between physical references anyone can find again afterwards. A distance estimated from a floor plan or by pacing it out goes in as pure error — and a percentage error in the distance becomes an equal percentage error in the speed.
- The projection. Two points equally spaced on the asphalt are not equally spaced in the image: whatever is further away appears closer together. Converting pixels into meters requires the relation between the image plane and the ground plane at that point — and it changes from one side of the frame to the other.
- The height. A plate, a roof and a mirror are not in the ground plane. If the entry and exit reference does not live in the calibrated plane, a systematic offset appears that does not average out with repetition, because it is not noise — it is bias.
Why does the frame rate quantize the instant?
Because a video does not observe time: it samples it. Between one frame and the next there is no information at all, and the instant at which the vehicle crossed the line can only be known to the precision of one interval between frames. The time measured is always a multiple of the sampling period, rounded.
The weight of that error is not the same in every measurement: it depends on the total time measured and on the duration of each frame. A fixed error of one frame weighs a great deal when the total time is short and very little when it is long. That is why the combination that supports a defensible number on one road does not necessarily support one on another — it is a sum for each scene, not a catalog figure, and anyone promising the same precision in any installation is promising what physics does not deliver.
No artificial intelligence model improves that number: what is coarse here is the system's clock, and no amount of training gives back information that was never sampled. The warning holds for anyone planning to reuse existing video surveillance — the stream reaching the analysis is not always what the sensor produced, and that has to be checked before any promise of measurement.
Which point on the vehicle was measured?
This is the source of error that most often goes unnoticed, and it is purely conceptual: the vehicle has length. Marking the entry when the front crosses the line and the exit when the rear crosses the other one makes the measured point travel something other than the gap.
The principle is simple and the consequence is large: if the reference changes point, the distance actually travelled is no longer the gap, and the division starts using a distance that is not the one measured on the ground. The rule that remains demands discipline, not cleverness: the same point on the same vehicle at entry and at exit, always.
An oblique angle makes the measurement worse even with the right distance
The more the camera looks at the road from the side, the more meters of asphalt fit into each pixel at the back of the scene, and the more a one-pixel error in the marking is worth in meters. The mechanism is in pixel density and DORI; what matters here is the consequence: the density lost turns into uncertainty in the final number, not just blur in the image.
The ForeSpeed case study measured this on a commercial forensic analysis product: average speed came out reliable under several conditions, but the uncertainty band increased significantly with strong perspective distortion.
Before installing anything, we measure the gap available, the real frame rate that camera delivers and the angle at which it sees the road. If the combination does not support a defensible number, that is the diagnosis — and it is cheaper to hear it in a report than to hear it from a resident who has challenged the measurement.
Why does an honest system discard the measurement instead of publishing a doubtful number?
Because one measurement knocked down does not take only that record with it: it takes the credibility of all the others, including the correct ones. At an HOA meeting, one poorly founded case is enough to turn the subject into an argument about the method.
The conditions that justify discarding a reading do not call for subjective judgment: they can be checked in the record itself, from the same three sources of error in this piece — the distance, the time and the reference. A serious system recognizes those situations and refuses the measurement instead of publishing a number it cannot support. Exactly which set of conditions that is, and how much each one weighs, is what years in the field teach; it is not a generic checklist to be copied out of a paper, and that is precisely where the difference lies between a reliable system and one that never discards anything.
A community speed radar is not a certified metrological instrument
In Brazil, a speed meter used for traffic enforcement is an instrument subject to legal metrology. Inmetro states that, under item 2.3.3 of the Regulamento Técnico Metrológico of Portaria Inmetro nº 158 of 2022 — Brazil's technical metrology regulation for speed meters — the maximum permissible errors in service for fixed, static and portable meters are ± 7 km/h up to 100 km/h and ± 7% above that.
A video system on an internal road goes through neither that type approval nor the periodic verification, and therefore does not produce a measurement with legal metrological value. The community is also not a traffic authority and does not apply penalties under Brazil's traffic code (Código de Trânsito Brasileiro, CTB) — its instrument is the community bylaws and the house rules, the subject of can a gated community fine a resident for speeding?.
So what is measuring for? For three concrete things.
- Deterrence. Speed that is measured and reported changes the behavior of drivers who know they are being measured.
- Documentary evidence. An unaltered record, with the instant, the place and the method stated, supports the procedure set out in the house rules — the theme of video evidence that holds up.
- Statistics for the road. A distribution of speed by time of day and by stretch allows a discussion about where to intervene, instead of a discussion about who is to blame.
It does not claim what the uncertainty of any real system is, ours included. The real error combines distance, time and reference, and it has to be surveyed in the field, scene by scene. This piece describes where the error comes from, not how much it is worth.
It does not claim which frame rate, which gap or which tolerance a project should adopt, nor does it publish an error band per configuration. That depends on the road, on the camera and on what the record has to support, and no OpenRadar calibration value appears here.
It does not claim that the maximum permissible errors of Portaria Inmetro nº 158 of 2022 apply to a video system on a private road. They apply to meters submitted to legal metrology — which is exactly the point: they are different regimes.
It does not claim that internal measurement replaces traffic enforcement. It does not, and it does not generate the penalties set out in the Código de Trânsito Brasileiro.
Sources
- Inmetro. Qual a margem de erro de medidor de velocidade (radar)? Frequently asked questions on legal metrology, published 13 April 2018 and updated 5 December 2023. gov.br/inmetro/pt-br/acesso-a-informacao/perguntas-frequentes/metrologia-legal/medidor-de-velocidade-radar/qual-a-margem-de-erro-de-radar Source of the reference to item 2.3.3 of the Regulamento Técnico Metrológico of Portaria Inmetro nº 158 of 2022 and of the maximum permissible errors of ± 7 km/h up to 100 km/h and ± 7% above that. Consulted on 4 September 2026.
- ForeSpeed: A real-world video dataset of CCTV cameras with different settings for vehicle speed estimation, arXiv preprint 2512.19364, December 2025. arxiv.org/abs/2512.19364 Source of the list of factors on which the accuracy of forensic speed estimation depends (camera, acquisition, spatial and temporal resolution, compression, perspective) and of the finding that the uncertainty band increases significantly with strong perspective distortion. Consulted on 4 September 2026.
- Brazil. Lei nº 9.503, de 23 de setembro de 1997 — Código de Trânsito Brasileiro, consolidated text. planalto.gov.br/ccivil_03/leis/l9503compilado.htm Basis for the statement that traffic enforcement and traffic penalties fall to the bodies of the Sistema Nacional de Trânsito, and not to the community. Consulted on 4 September 2026.
We measure vehicle speed on private roads using the cameras that are already installed, and we record every event with a SHA-256 signature anyone can check on their own. It is not a certified radar, and we say so before any conversation starts — what we deliver is traceable measurement and a record that survives a challenge.