Image Quality Factors

Shading

Image Quality Factors
  1. Introduction
  2. The background of shading
  3. Types of shading
  4. Luminance shading
    1. Natural shading (cos4 law)
    2. Mechanical shading or vignetting
    3. Measuring luminance shading
  5. Color shading
    1. Pixel crosstalk color shading
    2. IR-cut filter
    3. Measuring color shading
  6. Conclusion
  7. References

Introduction

The term shading describes the light fall off or color variation from the center of the sensor to the corners that does not originate from the captured scene. This event is often experienced as a decrease of the brightness in an image from the center to the corners. Occasionally a variation of color over the imaging field can occur particularly in cameras that have a small sensor. Overall, shading influences image quality by creating unwanted dark or shaded edges.

The background of shading

To visualize the shading of a camera system it is easiest to capture a flat field image which can be a photograph of a white paper that is uniformly illuminated or a photograph of a uniform diffuse light source such as the opening of an integrating sphere.

The minimum shading an optical system has is that of the cosine law described in photometry. The optical design of the system can increase it. Vignetting can occur from the physical limitations of the lens or other objects such as improper lens filters or false lens hoods.

Types of shading

ISO 17957 breaks down shading into two main categories for measurement.1 The first category is luminance shading, which the standard defines as a variation of the luminance signal components within the image field. The second category is color shading, a variation of the chrominance signal components within the image field1.

Luminance shading

Luminance (also known as lightness) shading can be broken down into a few separate groups depending on the where the shading is occurring from.

Luminance shading
Image 1: A typical test image showing the luminance shading from the center to the corners.

Natural shading (cos4 law)

Natural shading is when there is a light fall off from the center of the image to the corners. This type of shading is simply caused by geometry.

Natural shading
Figure 1: The geometric explanation of natural shading.

Figure 1 illustrates that the distance (D2) is D1 multiplied with the cosine of δ. It’s best to think of both D2 and D1 in two dimensions (or rather areas instead of dimensions), and thus the energy moving from D2 towards the lens is the energy of D1 multiplied by (cos δ)2. We now also have the same situation on the incident side of the lens as the energy transmitted by the lens is D2 multiplied by (cos δ)2.

Both of these areas together result in the cos4 law:

E(P2) = E(P1) * (cos δ)4

The maximum amount of natural shading in an image is determined by the field of view of the camera. For example, a wide-angle image contains more natural shading than a telephoto image.

Mechanical shading or vignetting

Another part of luminance shading is known as mechanical shading and often called vignetting. This type of shading is caused by the lens mount or other accessories such as the lens hood. It usually depends on the aperture or f-number, and smaller apertures normally show lower mechanical shading.

Mechanical shading
Figure 2: The explanation for mechanical shading.
Mechanical shading
Image 2: Mechanical shading with an open and closed aperture.

Measuring luminance shading

When measuring luminance shading, ISO 17957 differentiates between the CIELAB method of “lightness non-uniformity” and the X, Y, Z method of “luminance non-uniformity” using two related formulas. The measurement is described in detail in the standard.

Lightness shading:

$$D_L=max\left[L^\ast(i)\right]-\left[L^\ast(i)\right]$$

Luminance shading

$$D_Y=\frac{max\left[Y(i)\right]-min\left[Y(i)\right]}{\max\left[Y(i)\right]}\ X\ 100$$

With the measurement results of luminance shading, a polynomial fit can be calculated and used to brighten the corners to compensate for the shading. Thus, compensating for a moderate shading level can be done in the camera imaging piper or during the raw image processing.

Shading measurement
Image 3: Luminance shading measurement results from the iQ-Analyzer.

Color shading

Color shading (or color non-uniformity) describes a shift in color that is often seen from the center of the image to the corners. This type shading normally occurs in images that have been captured with a camera that has a smaller sensor. Color shading has multiple causes including the two most common types, pixel crosstalk off-axis and the transmission of the IR-cut filter.

Color shading
Image 4: A color shading example showing a magnet spot in the center with green corners.

Pixel crosstalk color shading

Pixel crosstalk off axis describes an increase in the spatial variation between (crosstalk) the pixels. Lenses that are not designed as near telecentric often experience pixel crosstalk shading.

Pixel crosstalk color shading
Image 5: Light collected by the sensor varies with the angle of incidence due to pixel crosstalk.

IR-cut filter

The transmission of the IR-cut filter shifts towards a shorter wavelength as the angle or incidence increases. The shift in the IR-cut filter has a stronger impact on the image if the light source contains a lot of IR radiance like natural sunlight or incandescent lights. Fluorescent tubes or LEDs, however, do not display this phenomenon as often due to the lag of the IR content in their spectrums.

Color shading
Image 6: This test chart image was taken with a light source that spectrally matches D55 (sunlight), depicts a significant amount of color shading along the edges.
Color shading
Image 7: The same test chart image captured with a D55 simulating fluorescent tube (no IR) does not show the color shading.

Measuring color shading

ISO 17957 outlines two separate formulas for measuring color shading. The first formula describes the chrominance non-uniformity and focuses on the differences in the a* and b* channels. The second formula details the total color non-uniformity, which takes into account the lightness L*.

Chrominance non-uniformity

An analysis of the chrominance non-uniformity is performed by first calculating the overall average (a*) ̅ and (b*) ̅ for the entire image using the block average values: a^* (i) and b^* (i).

$$\overline{a*}={1/m}\cdot\sum_{i=1}^{m}{a\ast\left(i\right)}\space\space \overline{b*}={1/m}\cdot\sum_{i=1}^{m}{b\ast\left(i\right)}$$ $$m:\mathrm{number\ of\ measurement\ blocks}$$

Calculate the chrominance deviation of the i block with the following formula.

$$D_c\left(i\right)=\sqrt{\left[a^\ast\left(i\right)-\bar{a^\ast}\right]^2+\left[b^\ast\left(i\right)-\bar{b^\ast}\right]^2}$$

The chrominance non-uniformity Dc is defined as the maximum deviation from the overall average of the following formula.

$$D_c=\max{\left[D_c(i)\right]}$$

Total color non-uniformity

An analysis of total color non-uniformity begins by first calculating the overall maximums and minimums of L*(i), a*(i), and b*(i).

$$L_{max}^\ast=max\left[L^\ast\left(i\right)\right],\ \ \ \ \ \ L_{min}^\ast=min\left[L^\ast\left(i\right)\right]$$

$$a_{max}^\ast=max\left[a^\ast\left(i\right)\right],\ \ \ \ {\ \ a}_{min}^\ast=min\left[a^\ast\left(i\right)\right]$$

$$b_{max}^\ast=max\left[b^\ast\left(i\right)\right],\ \ \ \ \ \ b_{min}^\ast=min\left[b^\ast\left(i\right)\right]$$

The total color non-uniformity DTotal is calculated by the following formula.

$$D_{Total}=\sqrt{\left(L_{max}^\ast-L_{min}^\ast\right)^2+\left(a_{max}^\ast-a_{min}^\ast\right)^2+\left(b_{max}^\ast-b_{min}^\ast\right)^2}$$

Conclusion

Shading describes a decrease of the brightness in an image from the center to the corners or a variation of color over the imaging field that often occurs in cameras that have a small sensor. Overall, shading influences image quality by creating unwanted dark or shaded edges.

To measure and visualize the shading of a camera system it is easiest to capture a flat field image which can be a photograph of a white paper that is uniformly illuminated or a photograph of a uniform diffuse light source such as the opening of an integrating sphere.

When we test for camera shading in our test lab, we closely follow the methods presented in ISO 17957. We have found that using a matt diffuser chart provides use with the best results for an overall evaluation of shading.