SMOOTHN(Y) automatically smoothes the uniformly-sampled array Y. Y can be any N-D noisy array (time series, images, 3D data,...).
SMOOTHN can deal with missing (NaN) values (see screenshot, top panels).
SMOOTHN(...,'robust') carries out a robust smoothing that minimizes the influence of outlying data (see screenshot, bottom right panel).
SMOOTHN is made automated by the minimization of the generalized cross-validation score.
Enter "help smoothn" in the Matlab command window for complete instructions and 1-D to 3-D examples.
------
Here is an example that requires the Image Processing Toolbox. The example below applies SMOOTHN to an image of Saturn that has had Gaussian noise added.
% Read the "Saturn" image from Matlab
I = rgb2gray(imread('saturn.png'));
% Add Gaussian noise to the image
J = imnoise(I,'gaussian',0,0.025);
% Remove the noise using the SMOOTHN function.
% Let SMOOTHN choose the amount of smoothness automatically
K = smoothn(J);
K = uint8(K); % back to 8-bit integer format
% Now check the result
subplot(121), imshow(J), title('Noisy Saturn')
subplot(122), imshow(K), title('Denoised Saturn')
------
Other 1-D to 3-D examples are given in:
http://www.biomecardio.com/matlab/smoothn.html
-----
For details about the algorithm, refer to:
http://www.biomecardio.com/pageshtm/publi/csda09.pdf
-----
|