File Exchange

image thumbnail

Kalman filter for noisy movies

version (2.79 MB) by Rob Campbell
Applies a Kalman filter to the time domain of an image sequence.


Updated 09 Jan 2010

View License

Run exampleFilter.m to see how the algorithm performs on a sample of moderately noisy 2-photon imaging data. This function is a faster, vectorised, version of Java code written by C.P. Mauer as part of an ImageJ plugin (see below).

function imageStack=Kalman_Stack_Filter(imageStack,percentvar,gain)

Implements a predictive Kalman-like filter in the time domain of the image stack. Algorithm taken from Java code by C.P. Mauer.

imageStack - a 3d matrix comprising of a noisy image sequence. Time is
the 3rd dimension.
gain - the strength of the filter [0 to 1]. Larger gain values means more
aggressive filtering in time so a smoother function with a lower
peak. Gain values above 0.5 will weight the predicted value of the
pixel higher than the observed value.
percentvar - the initial estimate for the noise [0 to 1]. Doesn't have
much of an effect on the algorithm.

imageStack - the filtered image stack

The time series will look noisy at first then become smoother as the
filter accumulates evidence.

Rob Campbell, August 2009

Comments and Ratings (2)

i would like to remove salt and pepper noise from an image using kalman filter. May someone help me in this to code in matlab as i am new to matlab.

MATLAB Release Compatibility
Created with R2009a
Compatible with any release
Platform Compatibility
Windows macOS Linux