Video Surveillance, lesson 2 of 14
How a camera makes a picture
Lesson 1 asked what, exactly, you need to see. To get it, you need to know how the camera sees. Every camera, from a doorbell to a stadium system, does the same four things in the same order. It gathers light, limits it, measures it and tidies up the result. Once you can follow light through those four steps, most picture faults explain themselves.
Make an exposure
Change the light and the three settings. Watch the opening inside the camera and the picture it produces.
The everyday picture
Put a row of buckets out in the rain to measure how hard it is raining. Each bucket collects for a set time, then you read the level.
In a downpour the buckets fill in seconds and overflow, and an overflowing bucket tells you nothing. In a drizzle they hold a few drops, and you can hardly tell one bucket from the next. To get a good reading in drizzle you have three choices: fit a wider funnel, leave the buckets out longer, or squint harder at the few drops you have.
A camera is that row of buckets, several million of them. The rain is light. The funnel is the lens opening, the collecting time is the shutter, and squinting harder is called gain. The whole lesson is in that picture.
Four parts in a row
- LensCurved glass that bends the light from each point in the scene to one point inside the camera. It forms a small, sharp, upside-down image. Lesson 3 is about lenses.
- IrisAn adjustable hole in the lens, like the pupil of your eye. A wide hole lets in a lot of light. A small hole lets in a little.
- SensorA chip covered in millions of tiny light meters called pixels. Each one counts the light that lands on it while the shutter is open.
- ProcessorA small computer that turns the raw counts into a clean color picture, many times a second, then squeezes it and sends it down the cable.
Two details are worth knowing. First, the image on the sensor is upside down, as the crossing beams in the drawing show. The processor simply flips it. Second, a security camera has no moving shutter blade. The shutter is electronic: the sensor is told to start counting and then to stop. The time between is the shutter time, written as a fraction of a second, such as 1/60.
Three ways to get more light
The amount of light used to make one picture is called the exposure. Too little and the picture is dark. Too much and bright areas turn plain white, with all detail gone. Three settings control it, and each one charges a different price.
| Setting | How it is written | More light by | The price |
|---|---|---|---|
| Iris | An f-number: f/1.4, f/2, f/2.8, f/4, f/5.6, f/8 | A lower f-number, which is a wider hole | Less depth is in focus at once |
| Shutter | A fraction of a second: 1/30, 1/250 | A longer time | Anything that moves is smeared |
| Gain | Decibels, dB | A higher number | Grain, called noise |
The f-number runs backwards, and that catches everyone once. A low number is a big opening. Each step along the row above halves the light, so f/4 passes a quarter of what f/2 passes. A step that doubles or halves the light is called a stop.
Depth of field is how much of the scene, from near to far, is sharp at the same time. With the iris wide open it is shallow: focus on the doorway and the wall behind goes soft. Watch the window in the picture above as you move the iris.
Gain adds no light at all. It multiplies the numbers the sensor produced, including the random errors in them. Those errors show as speckles that dance from one frame to the next. About 6 dB of gain doubles the signal, the same as one stop.
In daily use the camera sets all three by itself. This is auto exposure. Your job is to set the limits it must stay inside, above all the slowest shutter it may use.
Check yourself
At night a camera shows a bright, clean picture of an empty lobby. When someone walks through, they are a see-through streak. Which setting did the camera lean on to get its light?
The sensor up close
A pixel measures brightness only. It cannot tell red from blue. To get color, the sensor has a tiny colored filter over every pixel, in a repeating pattern of four: two green, one red, one blue. The processor works out the full color at each spot from its neighbors.
Sensors are described by two numbers: how many pixels, and how big the chip is. The size is given as an odd-looking fraction of an inch. It is a type name left over from old camera tubes, not a measurement you could check with a ruler.
| Sensor type | Approximate width of the chip | Where you meet it |
|---|---|---|
| 1/3 inch | About 4.8 mm | Older and low-cost cameras |
| 1/2.8 inch | About 5.6 mm | The most common size in today's cameras |
| 1/1.8 inch | About 7.2 mm | Cameras sold for low light and for 4K |
Size matters because of the buckets. Put the same number of pixels on a bigger chip and each pixel is bigger, so it catches more light. Squeeze more pixels onto the same chip and each one gets smaller and catches less. That is why an 8-megapixel camera can be worse at night than a 2-megapixel camera with the same size of sensor. Widths vary a little between chips, so take the real figure from the data sheet when you need it in lesson 3.
What the processor adds
- Color. It fills in the two missing colors at every pixel.
- White balance. Lamps are orange, shade is blue. The processor shifts the colors so that white things look white.
- Noise reduction. It smooths the speckles. Overdone, it also smooths away fine detail and leaves a trail behind moving things.
- Sharpening. It boosts edges to make the picture look crisper.
- Frames. It does all of this for every picture, or frame. Security video usually runs at 10 to 30 frames per second.
- Compression. It shrinks the video so it can travel over a network and fit on a disk. Lesson 7 covers that step.
The frame rate sets a ceiling on the shutter time. At 30 frames per second there is a new frame every 1/30 of a second, so the shutter cannot stay open longer than that unless the camera quietly drops frames. Many cameras are allowed to do exactly this at night, with a feature often called slow shutter. It makes an empty room look wonderful and turns people into ghosts.
Which setting is to blame?
Read each complaint and decide where the fault lies. This is the first skill of camera fault finding: name the stage before touching anything.
Six complaints
Pick the stage that best explains each one, then read why.
Three examples
Simple: ghosts in the lobby
A customer says the lobby camera is "fine by day and useless at night". At night, people leave trails. You open the exposure settings and find the slowest shutter allowed is 1/4 of a second. A person walking at about 4 feet per second moves a whole foot in that time.
You set the slowest shutter to 1/30. The night picture becomes darker and a little grainy, and people are sharp again. To win back the brightness you add light to the lobby, which costs nothing in blur or grain.
Medium: sharp at noon, soft at midnight
A camera with an adjustable lens was focused by hand on a sunny afternoon and looked perfect. At night it is soft. Nothing moved and nothing is dirty.
In sunlight the iris had closed down to a small hole. A small hole gives a deep depth of field, which hides a focus that is slightly off. At night the iris opens fully, the depth of field shrinks, and the error shows. The fix is to focus when the iris is wide open: at dusk, or with a dark filter held in front of the lens so the camera opens up. Many newer cameras have a motor that refocuses for you, but the reason is the same.
Advanced: a plate at a gate
A camera at a gate reads license plates well when cars stop, and fails when they roll through at 15 miles an hour. The shutter is at 1/30. Fifteen miles an hour is 22 feet per second, so in 1/30 of a second the plate moves about 9 inches. The characters on it are only a few inches tall.
The usual answer is a shutter of 1/1000 or faster, which cuts the movement to about a quarter of an inch. But 1/1000 is roughly 33 times shorter than 1/30, which is five stops less light. The iris and gain cannot make up five stops at night without ruining the picture. So the design needs more light on the plate, usually from an infrared lamp, which lesson 5 explains. The shutter sum told you that before anything was installed.
From the field
- Set the slowest shutter on every camera. For general scenes, 1/30 is a common limit. Where people walk close to the camera, faster is better. Check what the factory setting allows, because it is often much slower.
- Judge night pictures with something moving. Walk through the view yourself, or wave an arm. An empty scene hides blur and noise reduction trails.
- Focus at the worst moment. Wide iris, low light. If it is sharp then, it is sharp always.
- Clean the front glass before blaming the camera. A film of dust or a spider web scatters light and looks like poor focus, most of all at night.
- Add light before adding gain. Light is the only cure that has no price in the picture.
Common mistakes
- Reading a low f-number as a small opening. It is the widest.
- Leaving slow shutter switched on and approving the picture with nobody in it.
- Choosing a camera by megapixels alone, with no thought for sensor size and night performance.
- Turning noise reduction to maximum, then wondering why faces look like wax.
- Focusing a manual lens in bright daylight and never checking it after dark.
Summary
- Light passes through the lens and iris, lands on the sensor, and is finished by the processor.
- Exposure is set by iris, shutter and gain. A wide iris costs depth of field, a long shutter costs sharp movement, and gain costs a clean picture.
- One stop is a doubling or halving of light. Each f-number step is one stop, and so is about 6 dB of gain.
- Bigger pixels catch more light. More megapixels on the same chip means smaller pixels.
- When there is not enough light, the best fix is more light.
Exercises
Answer each one yourself first, then open the answer.
Exercise 1. Which opening is wider, f/1.4 or f/4? How much more light does it pass?
Show answer
Exercise 2. A person walks across the view at 4 feet per second. How far do they move during a 1/8 second exposure, in inches?
Show answer
Exercise 3. Two cameras have the same 1/2.8 inch sensor. One has 2 megapixels and the other 8. Which would you expect to give the cleaner picture in poor light, and why?
Show answer
Exercise 4 (think, don't memorize). A warehouse aisle is dim. The camera's picture is too dark. The iris is already wide open. The customer suggests "just turn up the brightness". What are the real options, and which would you recommend?