The Change_Detection.m MATLAB tool detects changes in an image by comparing the image to a background estimation. The change detection software is a MATLAB function designed to work on either a single image or a sequence of images, and computes changes with respect to a background image by one of four techniques:
- Frame-to-frame change detection — the change detection image represents the difference between two frames.
- Rolling median change detection — the change detection image represents the difference between an image and a median background estimation taken over a subset of the total frames presented to the function.
- Rolling mean change detection — the change detection image represents the difference between an image and a mean background estimation taken over a subset of the total frames presented to the function.
- Rolling mode change detection — the change detection image represents the difference between an image and a mode background estimation taken over a subset of the total frames presented to the function.
The software is an improvement on other scripting techniques by functionalizing the code with an INPUT/OUTPUT structure format that may work either at the command line or in conjunction with a separate graphic user interface function. The function also allows periodic background estimations instead of background estimations on a per-frame basis.
All computation is done on grayscale imagery, so color or multispectral images will be first converted to grayscale. Differences from the background that exceed a preset threshold are reported as changes in the form of a returned binary mask.
The algorithm can work in singleframe or multi-frame mode. In singleframe mode, only one image is being investigated for changes relative to a background. In multi-frame mode, a sequence of images is being investigated for changes relative to the background.
After the image changes are detected, the image is then converted into a binary representation of the change detection image by setting a threshold. The threshold is given as multiples of a standard deviation of the values in the difference image (the difference between the image and the background). The binary change detection mask is then multiplied by the original image in the sequence to obtain the values of the pixels that have changed. The outputted mask is the same size as the inputted frame, but now only the pixels that have changed are non-zero.
This work was done by David M. Palacios and Steven J. Lewis of Caltech for NASA’s Jet Propulsion Laboratory. NPO-47671
This Brief includes a Technical Support Package (TSP).

Change_Detection.m
(reference NPO-47671) is currently available for download from the TSP library.
Don't have an account?
Overview
The document describes the Change_Detection.m algorithm developed by the Jet Propulsion Laboratory (JPL) at the California Institute of Technology. This software tool is designed for detecting changes in images by comparing them against a static background image. The algorithm operates on grayscale imagery, requiring color or multispectral images to be converted to grayscale before processing.
Change_Detection.m can function in two modes: single frame and multi-frame. In single frame mode, it analyzes one image for changes relative to a background, while in multi-frame mode, it examines a sequence of images. The algorithm allows for external computation of the background image, or it can compute the background automatically using a sequence of images.
There are four built-in modes for background computation within the algorithm:
- Frame-to-frame change detection: This mode detects changes by comparing two consecutive frames.
- Rolling median change detection: This mode uses a median background estimation from a subset of frames to identify changes.
- Rolling mean change detection: Similar to the median mode, but it uses a mean background estimation.
- Rolling mode change detection: This mode utilizes a mode background estimation for change detection.
Once changes are detected, the algorithm converts the change detection image into a binary mask by applying a threshold based on the standard deviation of the difference image. The resulting binary mask highlights the pixels that have changed, allowing for easy identification of alterations in the original image.
The core inputs required for the Change_Detection.m algorithm include the index image (the image being analyzed), an optional background image (if computed externally), and the type of change detection desired if the algorithm is to compute the background itself. The document emphasizes the importance of providing either preloaded images or a directory path for the algorithm to access the necessary frames for background computation.
Overall, Change_Detection.m is a versatile and efficient tool for image analysis, particularly useful in fields such as remote sensing, environmental monitoring, and any application where detecting changes in imagery is critical. The document serves as a technical support package, providing essential information about the algorithm's functionality and usage.

