You are here : matlabImage Processingimgaussfilt

imgaussfilt() - Image Processing

B = imgaussfilt(A) filters
image A with a 2-D Gaussian smoothing kernel
with standard deviation of 0.5. Returns B, the
filtered image.B = imgaussfilt(A,sigma) filters
image A with a 2-D Gaussian smoothing kernel
with standard deviation specified by sigma. B = imgaussfilt(___,Name,Value,...) filters
image A with Name-Value pairs used to control
aspects of the filtering.examplegpuarrayB = imgaussfilt(gpuarrayA,___) performs
the filtering operation on a GPU. The input image must be a gpuArray.
The function returns a gpuArray. This syntax requires
the Parallel Computing Toolbox™.Code Generation support:
Yes.MATLAB Function Block support:
Yes.


Syntax

B = imgaussfilt(A)B = imgaussfilt(A,sigma)B = imgaussfilt(___,Name,Value,...)gpuarrayB = imgaussfilt(gpuarrayA,___) example


Example

Smooth image with Gaussian filterOpen This Example
Read image to be filtered.I = imread('cameraman.tif');
Filter the image with a Gaussian filter with standard deviation of 2.Iblur = imgaussfilt(I, 2);
Display all results for comparison.subplot(1,2,1)
imshow(I)
title('Original Image');
subplot(1,2,2)
imshow(Iblur)
title('Gaussian filtered image, \sigma = 2')

Smooth Image with Gaussian Filter on a GPU
This example shows how to perform a Gaussian
smoothing operation on a GPU.
Read image to be filtered into a gpuArray.I = gpuArray(imread('cameraman.tif'));
Perform Gaussian smoothing.Iblur = imgaussfilt(I, 2);
Display all the results for comparison.subplot(1,2,1), imshow(I), title('Original Image');

subplot(1,2,2), imshow(Iblur)
title('Gaussian filtered image, \sigma = 2')


Output / Return Value


Limitations


Alternatives / See Also


Reference