# Static Subtraction

Aim

To detect the subject, assuming that the background does not change over time.

How Static Subtraction works

The video image is converted to monochrome. Each pixel in the image has a gray scale value, ranging from 0 (black) to 255 (white). With the Static subtraction method, you choose an image of the arena without the subject, named Reference Image. When analyzing the images, EthoVision XT subtracts the gray scale value of each pixel in the reference image from the gray scale value of the corresponding pixel in the current image (live or from video files). The pixels with non-zero difference are considered the subject.

You can remove small non-zero differences by defining the contrast between current image and background that must be considered as the subject (see the procedure below). The remaining pixels are considered as the background.

Below: An example of how the Static subtraction detection method works. The gray scale value of each pixel of the reference image is subtracted from the gray scale value of each pixel of the live image. The result is ‘0’ for every pixel; if the difference > ‘0’ and within the gray scale range you have set, these pixels are considered to be the subject. So, with this method your task is to specify the contrast that optimizes the detection of the subject.

Procedure

1.In the Detection Settings pane, click Advanced, then Method. Select Static subtraction.

2.Click the Background button. The Reference Image window opens with the image that is currently used as background. The aim is to obtain a reference image that does not contain images of the animals you want to track. To do so, follow the instructions on the screen in consecutive order. If A fails, move on to B, if that fails move on to C. See also Optimize the reference image.

3.From the Subject color … list, select one of the following, depending on the color of the subject you want to track:

Brighter: For example, to track a Wistar rat in a black open field.

Darker: For example, to track a C57BL6 mouse in an open field with white bedding.

Brighter and darker: For example, to track a DBA2 mouse in a home cage with white background and a black shelter, or a hooded (black and white) rat in a uniform gray open field.

Depending on the selection above, different contrast sliders become available. For each slider, the contrast varies from 0 (no contrast) to 255 (full contrast). Unlike with Gray scaling, the values selected with the sliders represent the difference between the current and the reference image, not absolute gray scale values.

4.Release the subject in the arena, or position the media file at a point where the subject is moving.

5.Move the appropriate slider or type the values in the corresponding fields to define the lower and higher limits of the contrast that corresponds to the subject. In the Video window, check the quality of detection.

example 1 The subject is brighter than the background. Only the whiter area of the subject is detected.

Move the Bright slider to the left to increase the range towards values of lower contrast between subject and background.

example 2 The subject is darker than the background. Its body is detected only partially in the area of lower contrast.

Move the Dark slider to the left to increase the range towards lower values of contrast between subject and background.

example 3 The subject is brighter and darker than the background. Only the darker areas of the black fur are detected.

Move the Bright slider to the left to increase the range towards less contrast between the subject's white areas and the gray background. Then, move the Dark slider to the left to increase the range towards less contrast between the subject's black areas and the background.

6.Move the sliders until the subject (or the part which is of interest) is detected fully, and the noise is minimized. Check that the subject is properly detected in all parts of the arena by playing back different parts of the video file, or by waiting for the live animal to move.

Notes

When the subject is brighter and darker than the background, detection only works well when there is enough contrast between the areas of different brightness and the background. For example, tracking a hooded rat works well when the background is intermediate between black and white. Rather, use Differencing.