From Wikibooks, open books for an open world
Jump to navigation Jump to search


This component subtracts a background image from the input image. If the camera is fixed, only the objects added to the scene remain after this subtraction. However, light condition varations or the camera noise can also produce differences between the two images. Subtracting the average intensity of the two images makes the system more robust to changing light conditions.

Most of the time, a threshold is applied after this method.


SwisTrack GrayImage.jpg

A grayscale image.


SwisTrack BackgroundSubtractionGray.jpg

A grayscale image.


Background Image[edit]

Path to the background image file (grayscale). The background image must be a picture of the arena without the object to track.

SwisTrack GrayBackground.jpg


The subtraction mode:

  • Abs(I - B) calculates the absolute difference between the input image and the background image. If an object has moved between the background image and the input image, this object will appear twice (indistinguishable) on the resulting image.
  • Truncate(I - B, 0..255) subtracts the background image from the input image and sets all negative values to zero. Hence, objects that have moved between the background image and the input image will only appear once.
  • Truncate(B - I, 0..255) is similar, but subtracts the input image from the background.

Correct Mean[edit]

Specifies whether to correct the average intensity value of the input image with the average intensity value of the background image. This option makes the tracking less sensitive to varying light conditions.