Code covered by the BSD License  

Highlights from
Faster Kuwahara filter

Be the first to rate this file! 7 Downloads (last 30 days) File Size: 2.62 KB File ID: #15027
image thumbnail

Faster Kuwahara filter

by Luca Balbi

 

17 May 2007 (Updated 18 May 2007)

Performs a very fast Kuwahara filtering on images.

| Watch this File

File Information
Description

This function performs a Kuwahara filtering on images. It is optimized using vectorization, convolution and the fact that, for every subregion
    variance = (mean of squares) - (square of mean).
A nested-for loop approach is still used in the final part as it is more readable, but a commented-out, fully vectorialised version is provided as well.

This function is about 2.3 times faster than KuwaharaFast at
http://www.mathworks.com/matlabcentral/fileexchange/loadFile.do?objectId=13474&objectType=file
with a 5x5 window, and even faster at higher window sizes (about 4 times on a 13x13 window)

Kuwahara Filter description
The Kuwahara filter works on a window divided into 4 overlapping subwindows (for a 5x5 pixels example, see below). In each subwindow, the mean and variance are computed. The output value (located at the center of the window) is set to the mean of the subwindow with the smallest variance.

   ( a a ab b b)
   ( a a ab b b)
   (ac ac abcd bd bd)
   ( c c cd d d)
   ( c c cd d d)

References:
http://www.ph.tn.tudelft.nl/DIPlib/docs/FIP.pdf
http://www.incx.nec.co.jp/imap-vision/library/wouter/kuwahara.html

MATLAB release MATLAB 7.4 (R2007a)
Tags for This File  
Everyone's Tags
Tags I've Applied
Add New Tags Please login to tag files.
Comments and Ratings (1)
02 Dec 2007 Armani Etiquet

Hi how exactly to use this filter? I'm typing :
filtered = Kuwahara(original,5);
in command window, but ir drops me out:
"??? Undefined function or variable 'original'."
i tryed to put image name instrad of 'original' and image with wxtension - it diesn't work always says the same error.
I tryed to put integer value- then, there is no error but dunction does 'nothin'.(no action taken).

Please login to add a comment or rating.
Tag Activity for this File
Tag Applied By Date/Time
filtering Luca Balbi 22 Oct 2008 09:12:59
kuwahara Luca Balbi 22 Oct 2008 09:12:59
nonlinear filter Luca Balbi 22 Oct 2008 09:12:59
image Luca Balbi 22 Oct 2008 09:12:59

Contact us at files@mathworks.com