This is machine translation

Translated by Microsoft
Mouseover text to see original. Click the button below to return to the English verison of the page.

Note: This page has been translated by MathWorks. Please click here
To view all translated materals including this page, select Japan from the country navigator on the bottom of this page.

Image Filtering

Convolution and correlation, predefined and custom filters, nonlinear filtering, edge-preserving filters


Image Region AnalyzerBrowse and filter connected components in an image


imfilterN-D filtering of multidimensional images
fspecialCreate predefined 2-D filter
imgaussfilt2-D Gaussian filtering of images
imgaussfilt33-D Gaussian filtering of 3-D images
imguidedfilterGuided filtering of images
normxcorr2Normalized 2-D cross-correlation
wiener22-D adaptive noise-removal filtering
medfilt22-D median filtering
medfilt33-D median filtering
ordfilt22-D order-statistic filtering
stdfiltLocal standard deviation of image
rangefiltLocal range of image
entropyfiltLocal entropy of grayscale image
nlfilterGeneral sliding-neighborhood operations
imboxfilt2-D box filtering of images
imboxfilt33-D box filtering of 3-D images
padarrayPad array
imreducehazeReduce atmospheric haze
gaborCreate Gabor filter or Gabor filter bank
imgaborfilt Apply Gabor filter or set of filters to 2-D image
integralImageCalculate integral image
integralImage3Calculate 3-D integral image
integralBoxFilter2-D box filtering of integral images
integralBoxFilter33-D box filtering of 3-D integral images
bwareafiltExtract objects from binary image by size
bwpropfiltExtract objects from binary image using properties
fibermetricEnhance elongated or tubular structures in image
freqz22-D frequency response
fsamp22-D FIR filter using frequency sampling
ftrans22-D FIR filter using frequency transformation
fwind12-D FIR filter using 1-D window method
fwind22-D FIR filter using 2-D window method
convmtx22-D convolution matrix

Examples and How To

Spatial Domain

Filter Image using imfilter Function

This example shows how to filter an image with a 5-by-5 averaging filter containing equal weights.

Filter Multidimensional Images Using imfilter

This example shows how to filter the three color channels of an RGB image.

Filter Images Using Predefined Filters

This example shows how to create a type of special filter called an unsharp masking filter, which makes edges and detail in an image appear sharper.

Filter Images on Region Properties Using Image Region Analyzer App

This example shows how to filter a binary image based on properties, such as area and perimeter, of objects in the image.

Filter Images Using imfilter with Convolution

This example shows how to filter an image using convolution, and compares the result to filtering using correlation.

Noise Removal

Noise refers to random error in pixel values acquired during image acquisition or transmission. Removing noise can improve image quality.

Perform Flash/No-flash Denoising with Guided Filter

This example shows how to reduce noise from an image while using a guidance image to preserve the sharpness of edges.

Apply Gaussian Smoothing Filters to Images

This example shows how to blur an image using Gaussian smoothing filters of different strengths. The example includes isotropic and anisotroptic Gaussian filtering.

Segment Thermographic Image after Edge-Preserving Filtering

This example shows how to segment a hot object from the background in a thermographic image.

Apply Multiple Filters to Integral Image

This example shows how to smooth an image by different amounts by applying box filters of varying sizes to the integral image.

Reducing Noise in Image Gradients

This example shows how to reduce noise associated with computing image gradients.

Frequency Domain

Design Linear Filters in the Frequency Domain

You can design filters that modify the frequency content of images. Filtering in the frequency domain is often faster than filtering in the spatial domain.


What Is Image Filtering in the Spatial Domain?

In a spatially filtered image, the value of each output pixel is the weighted sum of neighboring input pixels. The weights are provided by a matrix called the convolution kernal or filter.

What is Guided Image Filtering?

Guided image filtering performs edge-preserving smoothing on an image. It uses the content of a second image, called a guidance image, to influence the filtering.

Integral Image

Integral images are a quick way to represent images for filtering. In an integral image, the value of each pixel is the summation of the pixels above and to the left of it.

Two-Dimensional Finite Impulse Response (FIR) Filters

The toolbox filters images using two-dimensional finite impulse response (FIR) filters, which are represented as matrices. FIR filters are easy to design and implement, and are more stable than other filter classes.

Was this topic helpful?