Image Processing Toolbox | ![]() ![]() |
Using Predefined Filter Types
The fspecial
function produces several kinds of predefined filters, in the form of correlation kernels. After creating a filter with fspecial
, you can apply it directly to your image data using imfilter
. This example illustrates applying an unsharp masking filter to an intensity image. The unsharp masking filter has the effect of making edges and fine detail in the image more crisp.
I = imread('moon.tif'); h = fspecial('unsharp'); I2 = imfilter(I,h); imshow(I), title('Original image') figure, imshow(I2), title('Filtered image')
![]() | Filtering Using imfilter | Filter Design | ![]() |