Appendix B. Cameras and Lenses

Chapter 5 discussed the importance of lighting in a vision system. Of course, even the best lighting system will run into problems if the system is using the wrong camera. This appendix provides a brief introduction to some of the issues when choosing a camera. It covers:

  • Basics of digital cameras

  • A background on lenses

Cameras and Digital Sensors

Cameras have sensors that measure incoming light levels and then map that light onto a grid to form an image. Before digital photography became dominant, this process was done chemically, where the chemicals on the film would react to the light coming through the lens. Today, digital cameras have replaced chemicals with millions of little sensors that detect incoming light.

There are two commonly used digital light sensors: Charge Coupled Device (CCD) and Complementary Metal Oxide Semiconductor (CMOS):

  • CCD is the most commonly used sensor in digital cameras. As a general rule, they create good quality, low noise images. However, they tend to require more power, making them less popular for cell phones, tablet computers, and other portable devices.

  • CMOS uses less power than CCD. This means they are rapidly gaining in popularity as cameras are included in many battery powered devices. However, CMOS tends to result in lower quality and higher noise images. In addition, they are less light sensitive, which means they do not work well in low-light conditions.

Light sensors are color blind. To create color, light must be broken into the primary colors: red, green and blue. One approach is to use color filters, which rapidly rotate through the three colors in the hopes of capturing identical images filtered by color. This approach will be problematic if the object being photographed is rapidly moving. An alternative is a beam splitter. This splits the light beam into its red, green, and blue components, which are then sent to sensors for each color. Although this solves problems inherent in color filters, it adds bulk to the camera, which is problematic with small devices. To resolve these problems, many cameras instead have adjacent pixels capture different colors. One pixel captures red information, an adjacent pixel captures green information, and a third pixel captures the blue information. This approach is called a Bayer Filter, as demonstrated in Figure B-1. As long as the pixels are small enough, the independent pixel colors can be blended together to form the appropriate combined colors.

A Bayer filter for capturing color

Figure B-1. A Bayer filter for capturing color

Like film-based cameras, digital light sensors are affected by the amount of time they are exposed to light. In a film camera, exposure time referred to the amount of time the shutter was opened, therefore exposing the chemicals to the light. Digital cameras do not need a physical shutter. Instead, exposure time in a digital camera refers to the time frame in which the sensors are exposed to the light, collecting information about light levels, before the values are digitally reset and the process begins again.

As a final note for this section, most modern consumer-level cameras are marketed based on megapixels. One megapixel equals a million pixels. It measures the number of points the image sensor can capture. This is usually a poor proxy for the overall quality of the camera. Putting a cheap lens in front of a high megapixel sensor merely results in a detailed capture of a rotten image. Most people cannot tell the difference between a cheap low megapixel image and an expensive high megapixel image. More megapixels can be helpful when cropping, zooming, and other types of slicing and dicing, but megapixels are a weak indicator of the quality of the camera.

Lenses

The final piece of the puzzle is the lens. Lenses are curved pieces of glass designed to direct light onto the camera’s sensor. Not all lenses are created equal. In addition to the common issues of zoom and focus, camera lenses can have unintended effects on your images. In the process of bending the light, a camera lens can also alter the contrast and color of the image, or create other anomalies. To help correct for these aberrations, most lenses are actually combinations of lenses. Most of these corrections are beyond the control of the camera operator, except to the extent that good camera lenses cost more money. Cheap lenses mean lower quality pictures.

The primary job of the camera lens is to focus the image on the camera’s image sensor, as demonstrated in Figure B-2. All of the incoming light should converge on the camera sensor. If the light converges ahead of or behind the sensor, then the image will be out of focus. If the image is not in focus, the lens is moved slightly forward or backwards until the image converges on the sensor.

Lens focusing on a single point

Figure B-2. Lens focusing on a single point

In addition to focusing the image, lenses are also responsible for controlling how much of the field of view the camera sees. This is based on the focal length of the camera. The focal length refers to the distance between the lens and the focal point where the image converges. If the image converges on the sensor, then the image will be in focus. Short focal lengths correspond to wide angles of view. Long focal lengths correspond to greater magnification and a smaller field of view. Figure B-3 shows the changing field of view and zoom-level for a camera taking pictures of a compass. Note, however, that most zoom lenses can perform more complex operations than simply varying the distance between the lens and the sensor.

Image of a compass, taken with different focal lengths

Figure B-3. Image of a compass, taken with different focal lengths

Many consumer-grade webcams are designed to focus on objects a couple of feet away—approximately the distance between a computer monitor and a person sitting at the computer—and therefore have limited or no ability to adjust their zoom level. However, they may be able to fake a zoom using digital techniques. Digital zoom has nothing to do with the camera’s lens. Instead, a digital zoom essentially crops the picture to the “zoomed” region and then resizes it to fill the same dimensions as the original image. Because such tricks can result in a pixelated image, most systems apply various smoothing algorithms to the image at the same time.

In addition to the focal length, lenses are also measured based on their aperture. This measures the size of the opening allowing in light. Aperture is usually measured as f-numbers, which are the ratio of the focal length to the aperture diameter. The smaller the f-number, the greater the aperture.

The obvious effect of aperture is to control the amount of light that reaches the camera’s sensor. The actual amount of light that hits the sensor is also controlled by the exposure time. A fast exposure requires a larger aperture to ensure that enough light reaches the sensor. In contrast, the aperture may need to be reduced with a slow exposure time to ensure that the image is not blown out with too much light.

In addition to affecting the amount of light reaching the sensor, aperture also affects the depth of field. This refers to how far away an object can be from the camera while still being in focus. In slightly technical terms, this is the result of collimated light. Collimated light refers to light traveling in nice, neat, parallel paths. Most light is bouncing around the environment, following many different paths. But it is easiest to clearly focus collimated light, especially when looking at distant objects. Closing the aperture results in more collimated light, as only light traveling in the right direction can make it through the smaller opening. This in turn makes it easier to focus on more distant objects.

Once again, webcams provide limited control over aperture. Instead of controlling the amount of light entering the camera via the aperture, most webcams use digital post processing to adjust the brightness. This often involves brightening tricks, such as described in Chapter 6, where images can be brightened by adding or multiplying values to their pixels.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset