# Thresholding for Change Detection

## Introduction

Due to its simplicity image differencing is a popular method for change detection. It only requires calculating the absolute values of the difference between the corresponding pixels in two images, and large values in the difference map then indicate locations of change.

The difference map is usually binarised by thresholding it at some pre-determined value to obtain a change/no-change classification. However, the threshold value is critical, since too low a value will swamp the difference map with spurious changes, while too high a value will suppress significant changes. The proper value of the threshold is dependent on the scene, illumination, etc. and should be calculated dynamically.

## Two New Thresholding Methods

Several general approaches are possible for determining thresholds for change detection. First the signal, noise, or both can be modelled. Second, either their intensity and/or spatial properties can be modelled. Here we will just describe the two spatial methods listed in the bottom row.

noise signal
intensity Normal model intensity distributions
spatial Poisson model stable number of regions
Table 1: Different categories of techniques for threshold selection

### Modelling the spatial distribution of the noise

If we assume that the noise is white then its spatial distribution over the image will be random. To quantify the randomness we will make the assumption that the observations follow a Poisson distribution. This can be tested using the relative variance Vr = s2 / x. It is calculated by first counting the number of observations (in our case the number of above threshold pixels in the difference map) in n windows, {x}i=1...n, from which the mean x, and variance s2, of the xi can be found. Although the test is sensitive to the window size and point density it works adequately as long as x is sufficiently large.

For our purposes we do not wish to detect the spatially random noise, but rather to avoid it in our thresholded image. We therefore select the threshold which maximises the relative variance, thereby maximising "clumpiness" (regions of change) and minimising the Poisson distribution (noise).

### Modelling the spatial distribution of the signal

The location, size, and number of the regions of change are generally unknown. However, we might expect that these properties will remain fairly stable over a wide range of threshold values, whereas down at the noise level small changes in the threshold value can substantially alter the number of regions. Such an observation suggests that if a range of threshold values is found that leads to a stable number of regions, then these regions are unlikely to come from noise, and so a value from this range will provide a suitable threshold. Rather than counting the number of regions the image's Euler number can be used, and gives almost identical results and can be computed more efficiently.

A stable threshold range will correspond to a plateau in the graph of the Euler numbers against thresholds. However, given the noisy, fragmented nature of images it is more to model the shape of the graph as a decaying exponential. Therefore a suitable partition point between the signal and noise is the "corner" of the curve. which we find as the point on the curve with maximum deviation from the straight line drawn between the end points of the curve.

## Experimental Results

Results are shown using methods based on: the Poisson distribution, the stable Euler number, the Normal noise intensity model, the Normal noise intensity model applied to the difference image constructed from two frames after running the Sobel edge detector, the Kolmogorov-Smirnov and Cramér-von Mises tests, Pearson's rank correlation coefficient, Spearman's rank correlation,

Both of the spatial methods (the Poisson noise model and the stable Euler number) generally performed best. Figure 1: Pedestrian crossing car park

More details of thresholding algorithms I have developed are given in the following papers:

• P.L. Rosin, J. Hervas, "Remote Sensing Image Thresholding Methods for Determining Landslide Activity", International Journal of Remote Sensing, vol. 26, no. 6, pp. 1075-1092, 2005.
• P.L. Rosin, E. Ioannidis, "Evaluation of global image thresholding for change detection", Pattern Recognition Letters, vol. 24, no. 14, pp. 2345-2356, 2003.
• P.L. Rosin, "Comments on "Ground from figure discrimination'" Pattern Recognition Letters, vol. 24, no. 15 , pp. 2761-2766, 2003.
• P.L. Rosin, "Thresholding for Change Detection", Computer Vision and Image Understanding, vol. 86, no. 2, pp. 79-95, 2002.
• P.L. Rosin, "Unimodal thresholding", Pattern Recognition, vol. 34, no. 11, pp. 2083-2096, 2001.
• P.L. Rosin, "Edges: saliency measures and automatic thresholding", Machine Vision and Applications, vol. 9, pp. 139-159, 1997.
• S. Venkatesh, P.L. Rosin, "Dynamic threshold determination by local and global edge evaluation", CVGIP: Graphical Models and Image Processing, vol. 57, no. 2, pp. 146-160, 1995.

You can download code to implement change detection.