Function File: `filter` = **fspecial**(`type, arg1, arg2`)

Create spatial filters for image processing.

typedetermines the shape of the filter and can be

"average"- Rectangular averaging filter. The optional argument
arg1controls the size of the filter. Ifarg1is an integerN, aNbyNfilter is created. If it is a two-vector with elementsNandM, the resulting filter will beNbyM. By default a 3 by 3 filter is created."disk"- Circular averaging filter. The optional argument
arg1controls the radius of the filter. Ifarg1is an integerN, a 2N+ 1 filter is created. By default a radius of 5 is used."gaussian"- Gaussian filter. The optional argument
arg1controls the size of the filter. Ifarg1is an integerN, aNbyNfilter is created. If it is a two-vector with elementsNandM, the resulting filter will beNbyM. By default a 3 by 3 filter is created. The optional argumentarg2sets spread of the filter. By default a spread of 0.5 is used."log"- Laplacian of Gaussian. The optional argument
arg1controls the size of the filter. Ifarg1is an integerN, aNbyNfilter is created. If it is a two-vector with elementsNandM, the resulting filter will beNbyM. By default a 5 by 5 filter is created. The optional argumentarg2sets spread of the filter. By default a spread of 0.5 is used."laplacian"- 3x3 approximation of the laplacian. The filter is approximated as
(4/(alpha+1))*[alpha/4, (1-alpha)/4,alpha/4; ... (1-alpha)/4, -1, (1-alpha)/4; ...alpha/4, (1-alpha)/4,alpha/4];where

alphais a number between 0 and 1. This number can be controlled via the optional input argumentarg1. By default it is 0.2."unsharp"- Sharpening filter. The following filter is returned
(1/(alpha+1))*[-alpha,alpha-1, -alpha; ...alpha-1,alpha+5,alpha-1; ... -alpha,alpha-1, -alpha];where

alphais a number between 0 and 1. This number can be controlled via the optional input argumentarg1. By default it is 0.2."motion"- Moion blur filter of width 1 pixel. The optional input argument
arg1controls the length of the filter, which by default is 9. The argumentarg2controls the angle of the filter, which by default is 0 degrees."sobel"- Horizontal Sobel edge filter. The following filter is returned
[ 1, 2, 1; 0, 0, 0; -1, -2, -1 ]"prewitt"- Horizontal Prewitt edge filter. The following filter is returned
[ 1, 1, 1; 0, 0, 0; -1, -1, -1 ]"kirsch"- Horizontal Kirsch edge filter. The following filter is returned
[ 3, 3, 3; 3, 0, 3; -5, -5, -5 ]

Package: image