Friday 14 January 2011

Part II: How a camera works and takes a photo

In this part of my guide for beginners, I'll explain how cameras form images.

The main elements of a camera are the lens, and the sensor. The lens captures light, "processes" it, and then sends an image to the sensor. The sensor records the image falling onto its surface. The rest of the camera supports the these two main ingredients.

The Lens

The lens, very simply, takes light travelling along one set of paths and directs them along different paths. The two important attributes of a lens are how much light is gathered, and how much the light is bent. A lens will usually be specified by a set of numbers and characters, e.g. 100mm f/4 or 24-105mm/3.5-4.5.

The first, how much, is the light gathering ability, or effective aperture of the lens. It is the effective size of the hole through which light can make it through to the sensor. The bigger the hole, the more light can be gathered in any given amount of time, hence photos can be taken "faster". This is why large aperture lenses are called "fast". The size of the aperture is usually given as a ratio of the focal length f (discussed below), e.g. f/4. This means that the diameter of the effective aperture is one fourth the focal length of the lens. Confusingly, the "/" is omitted, e.g. f4 or F4. A larger aperture is denoted by a smaller number (dividing the focal length by a smaller denominator gives a bigger aperture).

The second attribute, how much the light is bent, is the focal length of the lens, e.g. 100mm. A long focal length lens bends light less than a short focal length lens. Only light coming from near straight ahead will end up bent enough by a long focal length lens to make it to the sensor, compared to a short focal length lens, hence a long focal length lens will have a smaller angle of view. This gives a magnified view of the scene. A short focal length lens will bend  light more, hence light coming in from a greater angle will make it to the sensor giving a wide angle of view.

The angle of view of a particular focal length on a particular sensor size can be visualised easily using a rectangular cut-out of the same size of the sensor, and a piece of string the same length as the focal length of the string. By holding up the cut-out at the same distance from your eye (using the string to gauge the distance), the view through the cut-out will show the angle of view "seen" by the sensor looking through the lens. By bringing the aperture closer, the angle of view increases, putting it further away narrows the view.

A zoom lens can vary its focal length, by moving lens elements around, either internally or by telescoping the whole length of the lens. On most lenses, this will also affect the effective aperture of the lens, e.g. 24-105mm f/3.5-4.5 means that the lens has an effective f/3.5 aperture at 24mm focal length setting, and f/4.5 at the 105mm focal length setting. A few lenses are designed so that the aperture stays constant throughout the zoom range, e.g. 70-200mm/2.8 will have a constant f/2.8 aperture regardless of the focal length setting.

The aperture specifications discussed above refer to the maximum aperture that the lens is capable of. Usually, lenses can be set to close down the aperture, e.g. an f/4 lens could be set to f/11 for a particular shot. The minimum aperture is sometimes also quoted, typically in the range f/16-f/32, but this is usually less of a concern in most situations.

The Sensor

The sensor records the light falling upon it. In times gone by, this would have been a piece of film. Nowadays, the sensor is typically a piece of silicon upon which specialised electronic circuits have been etched.

Film consists of a backing material (polyester, glass etc.) upon which an emulsion of silver halides would be coated. Silver halides are light sensitive, they react when exposed to light. This reaction can be made visible by processing with chemicals to develop the latent silver grains. The unexposed silver halide could be disolved away by fixer leaving the exposed silver grains as a negative record of the light falling onto the film. This negative could then be used to project an image upon photographic paper (which works essentially the same way as photographic film) so that you get a negative image of the negative which results in a positive image.

A silicon CCD or CMOS imaging sensor operates using the same basic principle. When visible light falls on silicon, the light is absorbed and in the process, an electron is released. This free electron can then be collected in a photodiode in each pixel. The difference between CCD and CMOS is in the way that these collected photoelectrons are measured. In a CCD (charge coupled device), the electrons are transported, bucket-brigade like, to the periphery of the imaging area to special sense nodes where the total charge collected in each pixel is then measured. A CMOS sensor does not transport the electrons, but instead uses in-built transistors surrounding each pixel in order to measure the charge in situ.

The charge in each pixel is measured by a charge-voltage transducer. By varying the gain of this transducer, the effective ISO or sensitivity of the sensor can be altered. The voltage is then digitised by a ADC (analogue to digital converter) to give a number which is then recorded by the camera.

Taking a Photo

We will assume that we are using a compact digital camera, there are minor variations for SLRs and other types of digital cameras. The photo taking process then proceeds as follows:
  • Composition. The scene to be taken is framed.
  • Focus. The camera will adjust the lens so that the objects of interest are in focus. This is achieved by moving elements of the lens, or the whole lens itself in relation to the sensor.
  • Metering. The camera evaluates how much light to let through the lens and strike the sensor. This is controlled by two factors, the working aperture of the lens and the length of time the shutter stays open. The camera may also determine an effective ISO of the sensor for use in the readout phase.
  • Aperture closure. The aperture is closed down to the working aperture determined in the above step.
  • Shutter opening. Depending on the camera, the shutter may have already been open in order for the composition, focusing and exposure steps above. But before the actual taking of the photo, the shutter will usually be closed in order to reset the sensor (make it blank). When the actual photos is taken, the shutter will open to allow the image forming light to fall upon the sensor.
  • Sensor exposure. The light gathered by the lens is directed onto the sensor. This liberates free electrons from the silicon which is collected in each pixel.
  • Shutter closure. At the end of the exposure, the shutter closes to prevent extraneous light reaching the sensor.
  • Sensor readout. The photoelectrons are now measured and recorded.
To make better photos, the main elements to consider are composition, focus, aperture, shutter speed, and ISO. In the next section, we will see how these elements interact to affect the final photo.