fspecial
来源:互联网 发布:58同城网络销售可靠吗 编辑:程序博客网 时间:2024/06/05 08:39
fspecial
Create predefined 2-D filter
Syntax
h = fspecial(
type
)
h = fspecial(type
, parameters)
Description
h = fspecial(
creates a two-dimensional filter type
)h
of the specified type
. fspecial
returns h
as a correlation kernel, which is the appropriate form to use with imfilter
. type
is a string having one of these values.
h = fspecial(
accepts the filter specified by type
, parameters)type
plus additional modifying parameters
particular to the type of filter chosen. If you omit these arguments, fspecial
uses default values for the parameters
.
The following list shows the syntax for each filter type. Where applicable, additional parameters are also shown.
h = fspecial('average', hsize)
returns an averaging filterh
of sizehsize
. The argumenthsize
can be a vector specifying the number of rows and columns inh
, or it can be a scalar, in which caseh
is a square matrix. The default value forhsize
is[3 3]
.h = fspecial('disk', radius)
returns a circular averaging filter (pillbox) within the square matrix of size2*radius+1
. The defaultradius
is 5.h = fspecial('gaussian', hsize, sigma)
returns a rotationally symmetric Gaussian lowpass filter of sizehsize
with standard deviationsigma
(positive).hsize
can be a vector specifying the number of rows and columns inh
, or it can be a scalar, in which caseh
is asquare matrix. The default value forhsize
is[3 3]
; the default value forsigma
is 0.5. Not recommended. Useimgaussfilt
orimgaussfilt3
instead.h = fspecial('laplacian', alpha)
returns a 3-by-3 filter approximating the shape of the two-dimensional Laplacian operator. The parameteralpha
controls the shape of the Laplacian and must be in the range 0.0 to 1.0. The default value foralpha
is 0.2.h = fspecial('log', hsize, sigma)
returns a rotationally symmetric Laplacian of Gaussian filter of sizehsize
with standard deviationsigma
(positive).hsize
can be a vector specifying the number of rows and columns inh
, or it can be a scalar, in which caseh
is a square matrix. The default value forhsize
is[5 5]
and0.5
forsigma
.h = fspecial('motion', len, theta)
returns a filter to approximate, once convolved with an image, the linear motion of a camera bylen
pixels, with an angle oftheta
degrees in a counterclockwise direction. The filter becomes a vector for horizontal and vertical motions. The defaultlen
is 9 and the defaulttheta
is 0, which corresponds to a horizontal motion of nine pixels.To compute the filter coefficients,
h
, for'motion'
:Construct an ideal line segment with the desired length and angle, centered at the center coefficient of
h
.For each coefficient location
(i,j)
, compute the nearest distance between that location and the ideal line segment.h = max(1 - nearest_distance, 0);
Normalize
h
:h = h/(sum(h(:)))
h = fspecial('prewitt')
returns the 3-by-3 filterh
(shown below) that emphasizes horizontal edges by approximating a vertical gradient. If you need to emphasize vertical edges, transpose the filterh'
.[ 1 1 1 0 0 0 -1 -1 -1 ]
To find vertical edges, or for x-derivatives, use
h'
.h = fspecial('sobel')
returns a 3-by-3 filterh
(shown below) that emphasizes horizontal edges using the smoothing effect by approximating a vertical gradient. If you need to emphasize vertical edges, transpose the filterh'
.[ 1 2 1 0 0 0 -1 -2 -1 ]
Code Generation support: Yes.
MATLAB Function Block support: Yes.
Class Support
h
is of class double
.
Examples
More About
- fspecial
- fspecial函数
- matlab fspecial
- fspecial,imfilter
- fspecial,imfilter
- MATLAB fspecial
- matlab fspecial 用法解释
- MATLAB fspecial函数用法
- matlab 函数说明--fspecial
- matlab fspecial 用法解释
- matlab fspecial 用法解释
- fspecial()函数解析
- Matlab 的fspecial函数用法
- Matlab 的fspecial函数用法
- Matlab中fspecial的用法
- Matlab 的fspecial函数用法
- Matlab中fspecial的用法
- Matlab 的fspecial函数用法
- Ubuntu16.04 安装 shadowsocks-qt5 并使用chrome插件Proxy SwitchyOmega代理
- kindle paperwhite3 拆机越狱
- 机器学习—初见
- [Unity][安卓]Unity和Android Studio 3.0 交互通讯(2)Unity 设置
- MyBatis注解Annotation介绍
- fspecial
- 迷宫算法(java实现)
- Linux(Centos7)yum安装最新mysql
- EXISTS的应用
- 51nod
- 基于RobHess的SIFT图像拼接知识点随笔
- 实习记录5 再看fs框架
- 数组(五)--快速排序
- 高斯过程回归(Gaussian Process Regression)