Code covered by the BSD License  

Highlights from
Average Filter

4.0

4.0 | 1 rating Rate this file 54 Downloads (last 30 days) File Size: 2.95 KB File ID: #40174
image thumbnail

Average Filter

by Jan Motl

 

05 Feb 2013 (Updated 26 Feb 2013)

Average filter performs image smoothing with integral image method.

| Watch this File

File Information
Description

The advantage of this implementation in comparison to imfilter from Image Processing Toolbox is that the processing time is independent of window size. In practise it means that this implementation of mean filter is faster than imfilter whenever one of the window dimensions is bigger than 21 pixels.

MATLAB release MATLAB 6.5 (R13)
Tags for This File  
Everyone's Tags
average filter, fast, image, image processing, mean filter, moving window, smoothing
Tags I've Applied
Add New Tags Please login to tag files.
Please login to add a comment or rating.
Comments and Ratings (2)
28 Feb 2013 Jan Motl

Hi Jan,
thank you for your feedback. The biggest gain from the vectorised version is in calculation of the integral image - cumsum accelerated the whole function by 5%. And that is good.

12 Feb 2013 Jan Simon

Although I like FOR loops, here a vectorized approach would be much more efficient, e.g.:
output = (t(1+m:rows+m, 1+n:columns+n) + t(1:rows, 1:columns) -
t(1+m:rows+m, 1:columns) - t(1:rows, 1+n:columns+n)) / winNum;

The documentation is very good: H1 line, exhaustive descritpion of inputs and outputs, "See also" line. I only miss a date and the author.
The inputs are check reliably.

Updates
11 Feb 2013

Fixed copyright owner.

11 Feb 2013

Added padding parameters.

15 Feb 2013

Improved the help text. (Thanks Jan!)

26 Feb 2013

Vectorised version.

Contact us