SwisTrack/Components/BackgroundSubtractionGray

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

Description[edit | edit source]

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 variations 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.

Input[edit | edit source]

SwisTrack GrayImage.jpg

A grayscale image.

Output[edit | edit source]

SwisTrack BackgroundSubtractionGray.jpg

A grayscale image.

Parameters[edit | edit source]

Background Image[edit | edit source]

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

Mode[edit | edit source]

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 | edit source]

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.