# Gray Scaling

Aim

To detect the subject, under the assumption that its color is always different from that of the background (no shadows, gradients etc.).

How Gray scaling 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 Gray scaling, you define which range of gray scale values should be considered as the subject. The remaining gray scale values are considered as background. The Gray scaling method does not make use of a background image, the subject is determined by its gray scale values only.

Procedure

1.In the Detection Settings pane, click Advanced, then Method. Select Gray scaling.

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

3.Move the two sliders next to Range or type the values in the corresponding fields to define the lower and higher limits of gray scale values for the subject. Make sure there are no areas in the background with gray scale values that fall in this range, otherwise they will be detected as the subject.

4.In the Video window, check the quality of detection.

If the detected area (by default, in yellow) is too large, or other objects are detected as the subject, reduce the range in either direction (brighter or darker).

If the detected area is too small relative to the real subject, increase the range at least in one direction (brighter or darker).

Areas marked as noise (by default, in orange), indicate that the gray scale range is too wide: you need to narrow it in at least one direction.

5.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 moving the video slider, or by waiting for the live animal to move.

important The whole animal's body must be detected for optimal tracking. Proceed with the Contour adjustments to optimize body detection.