Skip to content

Shading and Fixed Pattern Noise Correction#

With shading and fixed pattern noise correction, you can solve three different problems of image acquisition.

In the chapters below, read how

  • defective pixels of the sensor can be detected and corrected,
  • the offset of black pixels can be eliminated (with the help of the dark current, many pixels don't have value 0, even if they aren't exposed to light),
  • irregular illumination ratio can be corrected by calculation using the runtime tool microDisplay X or the SDK.

For shading correction, two options are possible:

  • With subtractive correction (also called offset correction), the so-called dark current is corrected.
  • With multiplicative correction (also called gain correction), irregular illumination circumstances are corrected.

Fixed Pattern Noise Correction / Defective Pixel Interpolation#

Defective pixels of the sensor can be eliminated with the help of the so called Fixed Pattern Noise Correction (sometimes also called Dead Pixel Cancelation).

Test Image

The illustration above shows a test image. The defective pixels are visible in the enlarged cut-outs. They have been caused by defects within the sensor. For this reason, the defective pixels occur always at the same coordinates (therefore the name 'Fixed Pattern Noise'). As the positions of the defect pixels depend on the sensor, the pattern of the defective pixels is different for each camera sensor. Therefore, the correction of defective pixels has to be carried out for each camera.

For humans, the defective pixels in the illustration above are easy to detect. But how can defective pixels of the sensor be detected automatically? A defective pixel is a point within the image that doesn't measure the intensity of the incoming light. Thus, a defective pixel delivers a fix value, independent from light intensity. Therefore, it is easy to detect the dead pixels automatically by darkening the sensor field completely. In this case the defective pixels still deliver their constant value - they are brighter than the correct pixels.

Brightened image of the completely darkened sensor

The image above shows a brightened image of the completely darkened sensor.

Histogram  Histogram of the darkened sensor from illustration above

The image above shows a matching histogram of the darkened sensor.

The defective pixels of illustration 2 are marked white by a threshold of 36.

The image of a completely darkened sensor can be seen in the second figure. But the complete image has been brightened to see more details for reproduction. The defective pixels can be seen in plain like lightning stars in front of a lightly noisy background.

If we take a look at the histogram, we will see that mostly all pixel values will be round about the peak of the brightness value 15. Two things will astonish: Either, the pixel value for most of the pixels is not null even without light, nor the shifted dark point is blurred. The reason for it is the so called dark current which causes that the pixel value is greater than null, even without light. Moreover, the dark current for each pixel is slightly different which results in a bell-shaped arrangement.

In spite of the difficulties in fact of the dark current, defective pixels can be detected automatically, if the pixels outside the bell-shaped curve are surely dead pixels. This red borderline is shown in the histogram. In our example, the threshold is at 36.

If all pixel values which are greater than 36 within the dark image are marked white, the resulting image is shown in the last illustration above. Accordingly, all white pixels are defective and violates the image analysis. The interference can be reduced, if an interpolated (means calculated) pixel value improves the representation of the unknown pixel.

Test Image with fixed Pattern Noise Correction

The Fixed Pattern Noise Correction interpolates the value of defective pixels out of its left and right neighbors. Herewith, a linear interpolation will be used. That means, the average of neighbor pixels will be used for faulty pixels. The resulting image of such a correction is shown in the illustration above.

Shading Correction: Subtractive Calculation#

The Shading Correction contains two different parts: The subtractive correction and the multiplicative correction. With the subtractive correction, the so called dark current can be corrected. With the multiplicative correction, irregular illumination circumstances will be corrected.

If the sensor will be covered with a photoresistant item and an image will be acquired, the resulting image is a so called dark image of the sensor. In the figure below, an example of a brightend dark image is shown. With a perfect sensor, the dark image would be stady and all the pixel values would be exactly null. No real sensor can produce such an image.

Dark image of a sensor. For better reproduction, the image has been brightened a lot.

In a histogram of a (not brightened) dark image, the background noise of individual pixels can be seen. In contrast to a perfect sensor, not all the pixels are null, but most of the pixels are blurred and on the bell-shaped curve near 15.

The reason is that during exposure, in semi-conductor material electrons can get free because of temperature effects, even if no light has fallen on the sensor element and therefore, the messurement always will be greater than null. This effect is called the dark current and it is not only temperature depending, but it will be affected by the physical consistence (impurity) within teh sensor element of the corresponding pixel. Hence, the dark current is either temperature depending (which is in practice of little importance) and it is different for each sensor.

Histogram of the dark image above

The illustration above shows the matching histogram of the brightened dark image above.

Histogram of a dark image with enabled subtractive correction

The illustration above shows a histogram of a dark image with enabled subtractive correction.

Therefore, the dark current of a pixel is determined by its unchangable physical properties (temperature variation neglected). Consequence is the important property that the dark current for each pixel is different, but constant. Therefore, it has to be messured for each sensor only once.

After the derivation has been clarified, we can take a look at the effect according the image acquisition. In an ideal sensor, electrons will get free in the semi-conductor material. Its number is directly proportional to the indensity of the incoming light, so that the light indensity can be determined by messuring the originated stream. Hereof, the electrons that got free are independent in fact of temperature effects and they generate the additional dark current which falsify the messurement. The independence at the becoming of both streams enables the simple correction of light messurement by the subtraction of the additional dark current from the messured stream.

Herewith, it is obvious, how the messurement falsified by the dark current can be eleminated by the subtractive correction: Initially, the sensor has to be covered completely and the dark image has to be acquired as reference image. At this juncture, the messured pixel values are not null, but the pixel depending dark current. Because the dark current as additional component is contained in the light messurement, the dark reference image must be subtracted, so that the pattern in the image that has been caused by the dark current will be eleminated.

The effect of the subtractive correction gets more conspicuous in case of very dark images, that means in case of very small pixel values, because here, the relative fault is the biggest caused by the dark current. A trivial example is the acquisition of a dark image at enabled subtractive correction. The result is completely black as it could have been expected with a ideal sensor. We renounce the reproduction of such a completely black image, at this point, but it is shown in the histogram of the dark image with enabled subtractive correction. Obviously, the betterness can be seen: The bell-shaped curve in the histogram of the brightened dark image has become a small peak which is located at null.

Shading Correction: Multiplicative Calculation#

The Shading Correction contains two different parts: The subtractive correction and the multiplicative correction. With the subtractive correction, the so called dark current can be corrected. With the multiplicative correction, irregular illumination circumstances will be corrected.

The irregular illumination of an image field complicates the image analysis. Therefore, at assembly of apperatures it has to bee seen that an ideal illumination level can be guaranteed. Nevertheless, an illumination which is not perfect can not be avoided with a passable effort. Additionally, the lense system of the camera causes unavoidable and less good illuminated image margins.

Often, it will be tried to adjust this shortcoming of image acquisition with spatially adaptive algorithms. But it is more elegant to correct the static illumination shortcoming with multiplicative shading correction, already at image acquisition.

At this point, it is helpful to see an application for illustration, e. g. the binary segmentation of the image. The left side of the image below shows the image acquisition of a text that should be segmented into the two classes 'background' and 'text'. The result of the segmentation is shown in the same illustration (on the right). In the left top of the image the image is under segmented, that means, the letters are already illuminated in this image half, so that parts are classified as background. Besides, the bad illuminated image part on the right shows an over segmentation, where the background has been classified as text. The irregular illumination of an image area makes it unpossible to segment the image with a global threshold, that means with a uniform threshold for the whole image.

On the left: Text which is irregular illuminated. On the right: The same image, but binary segmented with a global threshold

The image below shows what would happen if the threshold would be reduced for correctly segmenting the letters on the right side of the image. The classification on the left top of the image would get even worse. In contrast, the opposite would be the result.

Reducing the threshold (left image), reduces the quality of segmentation in highly illuminated areas. Rising the threshold (right image), reduces the quality of segmentation in worse illuminated areas

To avoid the pattern noise which came up with the irregular illumination of the image field, the acquisition of an image is nesseccary which only contains the not perfect illumination circumstances. Such an image can be gotten, if a completely white image field will be acquired under given illumination circumstances. In such an image, each pixel would be exacly white, if it would be ideal illuminated and the camera's optic wouldn't cause pattern noise. Such an image is called white reference image. Important either is that the white reference image really is an illumination messurement, nor that an image region has been overexposed.

Thus, the white reference image describes the tolerance of the messured brightness of the ideal brightness (white). The white reference image can be gotten, if the whole image field will be covered with a white paper.

White reference image gotten by covering the image field with a white paper.

How can the not perfect illumination be corrected with a white reference image? Therefore, the meaning of such an image has to be understood. The image contains the dynamical value of each pixel. Per definition, each pixel in a white reference image has namely the maximum brightness under given circumstances. At a real image scene with objects, under the same illumination circumstances, each pixel will only have a value between null and its value in the reference image. The pixel depending dynamic values which is caused by illumination circumstances have to be rescaled to get a corrected image.

The result of the shading correction of this example is shown in the image below on the left. On the right you will see the segmentation of the image with a global threshold. Obviously, in both images to a large extent the correction of the irregular illumination can be seen.

On the left: The shading corrected image of illustration 9. On the right: The segmented image by a global threshold.

Finally, we like to point to principal difficulties of the multiplicative shading correction:

  • The coefficients of the multiplicative shading correction are static. Therefore, the white reference image has to be gotten under exactly the same illumination circumstances as during the later acquisition. Normally, it is given in controllable illumination circumstances (artificial illumination), only.
  • Because the illumination usually doesn't change with the two-dimensional projection of the image field on the sensor, but with the three-dimensional position of the object to acquire, it has to be payed attention about taking the white reference image by covering the same three-dimensional structure.

Not affected of these difficulties are the illumination differences which have not been caused by external effects, but by internal noise. So, the reduced illumination in the edges of the camera images is defined by the not perfect objective of the camera and, therefore, it can be corrected for any acquisition conditions.

Back to top