Cardinal Systems ·
In our experience, most failed container reads come from the picture, not the software. A camera that is fine for security (wide-angle, automatic exposure, covering the whole gate) often cannot read a container number at all. This guide covers what a camera needs, roughly in the order things go wrong, with numbers you can check against your own gate. It applies to any container number recognition (container OCR) system, not just ours.
Start with one test: freeze the picture
Before you change anything, record a few trucks passing. Pause on the frame where the number is clearest and zoom to 100%. If you can’t read all 11 characters by eye, no software will. If you can read them easily, the camera is probably fine and any problem lies elsewhere. Repeat the test at night: most cameras that read well at noon struggle at 6 pm.
1. Shutter speed: the most common problem
A moving container smears across the picture while the camera’s shutter is open. In our own test at a working gate, 14 of the 16 frames that could not be read were blurred by movement, the biggest single cause.
The blur is simple to work out: it is how far the container travels while the shutter is open.
| Speed | 1/100 s | 1/500 s | 1/1000 s | 1/2000 s |
|---|---|---|---|---|
| Truck at 10 km/h | 28 mm | 6 mm | 3 mm | 1 mm |
| Truck at 20 km/h | 56 mm | 11 mm | 6 mm | 3 mm |
| Train at 50 km/h | 139 mm | 28 mm | 14 mm | 7 mm |
Container numbers are usually painted around 100 mm tall; measure one of yours. A few millimetres of blur is harmless. At 30 mm or more, strokes run into each other and an 8 becomes a B. So:
- Road gates: set the shutter to 1/500 s or faster.
- Rail sidings, trains up to 50 km/h: about 1/2000 s.
Many CCTV cameras leave the shutter on “auto”. At dusk they slow it to 1/25 s or slower to brighten the picture, and at that speed a truck at walking pace moves more than a whole character height. In the camera’s exposure settings, set a fixed shutter speed (or a fastest-allowed limit) and save it.
2. Light: a fast shutter needs it
A faster shutter lets in less light, so the picture gets darker. At night that means one of:
- White light aimed at the reading zone. It keeps colours, and painted numbers stand out well.
- An infrared illuminator, if your camera has IR night mode. Check the freeze-frame: some paint and reflective labels look very different under IR.
Avoid pointing the camera towards the low sun or into oncoming headlights. If there’s bright sky behind the container, wide dynamic range (WDR) helps, but placement helps more.
3. Pixels on each character, not megapixels
What matters is how many pixels tall each character is in the picture. In our tests, characters about 25–30 pixels tall read reliably, and characters of 8–18 pixels could not be read.
You can work it out for your camera. Divide the picture width in pixels by the width of the scene it covers, in metres. Then multiply by the character height in metres: 0.1 for 100 mm characters.
| Camera and framing | Pixels per metre | ~100 mm character |
|---|---|---|
| 1920 px wide, framing 4 m of the lane | 480 | 48 px, reads well |
| 1920 px wide, framing 8 m | 240 | 24 px, borderline |
| 1280 px wide (a typical sub-stream), framing 6 m | 213 | 21 px, borderline |
| 3840 px (4K), covering a 30 m street | 128 | 13 px, will not read |
That last row is a real result: a 4K camera with a wide view of a whole street could not read container numbers.
- Frame the lane, not the gate. A varifocal (zoom) lens lets you fill the picture with the strip the containers actually pass through.
- Read from the full-resolution stream. Recorders often give each camera a second, low-resolution “sub-stream” for viewing on phones. Give the reading system the main stream’s address, not the sub-stream’s.
4. Angle and height
Numbers are painted on the doors, the sides and the roof. Pick the face your camera sees most squarely as the container passes, then:
- Keep the view as square-on as you can. The further off square, the more the characters squash. Roughly 30° to the side is a practical limit, and less looking up or down.
- Mount the camera level. A number that appears slanted in the picture is harder to read than one that sits straight. A camera rolled a little to one side causes more misses than people expect.
- Allow for numbers painted down the container. Some containers carry the number vertically, so make sure the whole column fits in the picture.
- One camera per direction. Reading the IN and OUT lanes with separate cameras keeps every record’s direction right.
At a rail siding, a camera beside the track can read both boxes of a double stack as the wagon passes. Height and distance matter even more there, so plan them before buying cameras.
5. Frame rate and compression
- Frames: 15 frames per second or more gives the reader several clear looks at each number as it passes. More doesn’t help much.
- Bitrate: heavy compression smears fine detail on moving objects. If the stream you read from runs at a very low bitrate to save recorder space, characters lose their edges. Give it enough bitrate for detail.
6. Mounting and upkeep
- A rigid pole or wall. A camera that shakes when a truck passes blurs the picture even at a fast shutter.
- A clean lens. Wipe it and check it after storms. At night, a spider’s web in front of an IR camera can blank the picture.
- Re-check the shutter setting after a firmware update or reset. A factory reset puts exposure back to automatic.
Do you need a special camera?
Usually not. For our own system, Cardinal Container Tracker, any IP camera that provides an RTSP stream will do, as long as you can set the shutter speed yourself, frame the lane with a zoom lens and light the scene at night. The security camera you already have might work: run the freeze-frame test before buying anything. Often it needs re-aiming and a fixed shutter speed, or it’s simply too wide to read numbers.
Checklist
| Check | Target |
|---|---|
| Freeze-frame test, day and night | All 11 characters readable by eye |
| Shutter at road gates | 1/500 s or faster, fixed (not auto) |
| Shutter at rail sidings (up to 50 km/h) | About 1/2000 s |
| Character height in the picture | 25–30 px or more |
| Stream used for reading | Main (full-resolution) stream |
| View angle | As square-on as possible, camera level |
| Frame rate | 15 fps or more |
| Night | Added light or IR, re-checked by freeze-frame |
| Direction | One camera per lane direction |
What happens when a read fails
No camera reads every container: numbers get dirty, damaged or hidden by a trailer. What matters is what the system does next. Container Tracker accepts a number only if its ISO 6346 check digit is valid. A container it sees but cannot read is saved as “unread” with its photo, so someone can type the number from the picture. It never saves a guess as if it were right.
Planning a gate or a rail siding?
Tell us how many lanes or tracks you have and send a freeze-frame from your current camera. We’ll help you work out where the cameras should go.