Matlab 的fspecial函数用法详述

fspecial Create predefined 2-D filters.

H = fspecial(TYPE) creates a two-dimensional filter H of the

specified type. Possible values for TYPE are:

'average'   averaging filter

'disk'      circular averaging filter

'gaussian'  Gaussian lowpass filter

'laplacian' filter approximating the 2-D Laplacian operator

'log'       Laplacian of Gaussian filter

'motion'    motion filter

'prewitt'   Prewitt horizontal edge-emphasizing filter

'sobel'     Sobel horizontal edge-emphasizing filter

Depending on TYPE, fspecial may take additional parameters

which you can supply.  These parameters all have default

values.

fspecial函数用于建立预定义的滤波算子,其语法格式为:

h = fspecial(type)

h = fspecial(type,para)

其中type指定算子的类型,para指定相应的参数;

type的类型有:

1、'average'

averaging filter

为均值滤波,参数为hsize代表模板尺寸,默认值为【3,3】。

H = FSPECIAL('average',HSIZE) returns an averaging filter H of size

HSIZE. HSIZE can be a vector specifying the number of rows and columns in

H or a scalar, in which case H is a square matrix.

The default HSIZE is [3 3].

2、 'disk'

circular averaging filter

为圆形区域均值滤波,参数为radius代表区域半径,默认值为5.

H = FSPECIAL('disk',RADIUS) returns a circular averaging filter

(pillbox) within the square matrix of side 2*RADIUS+1.

The default RADIUS is 5.

3、'gaussian'

Gaussian lowpass filter

为高斯低通滤波,有两个参数,hsize表示模板尺寸,默认值为【3 3】,sigma为滤波器的标准值,单位为像素,默认值为0.5.

H = FSPECIAL('gaussian',HSIZE,SIGMA) returns a rotationally

symmetric Gaussian lowpass filter

of size HSIZE with standard

deviation SIGMA (positive). HSIZE can be a vector specifying the

number of rows and columns in H or a scalar, in which case H is a

square matrix.

The default HSIZE is [3 3], the default SIGMA is 0.5.

4、'laplacian' filter approximating the 2-D Laplacian operator

为拉普拉斯算子,参数alpha用于控制算子形状,取值范围为【0,1】,默认值为0.2.

H = FSPECIAL('laplacian',ALPHA) returns a 3-by-3 filter

approximating the shape of the two-dimensional Laplacian

operator. The parameter ALPHA controls the shape of the

Laplacian and must be in the range 0.0 to 1.0.

The default ALPHA is 0.2.

5、'log'

Laplacian of Gaussian filter

为拉普拉斯高斯算子,有两个参数,hsize表示模板尺寸,默认值为【3 3】,sigma为滤波器的标准差,单位为像素,默认值为0.5.

H = FSPECIAL('log',HSIZE,SIGMA) returns a rotationally symmetric

Laplacian of Gaussian filter of size HSIZE with standard deviation

SIGMA (positive). HSIZE can be a vector specifying the number of rows

and columns in H or a scalar, in which case H is a square matrix.

The default HSIZE is [5 5], the default SIGMA is 0.5.

6、'motion'

motion filter

为运动模糊算子,有两个参数,表示摄像物体逆时针方向以theta角度运动了len个像素,len的默认值为9,theta的默认值为0;

H = FSPECIAL('motion',LEN,THETA) returns a filter to approximate, once

convolved with an image, the linear motion of a camera by LEN pixels,

with an angle of THETA degrees in a counter-clockwise direction. The

filter becomes a vector for horizontal and vertical motions.

The

default LEN is 9, the default THETA is 0, which corresponds to a

horizontal motion of 9 pixels.

7、'prewitt'

Prewitt horizontal edge-emphasizing filter

用于边缘增强,大小为【3 3】,无参数

H = FSPECIAL('prewitt') returns 3-by-3 filter that emphasizes

horizontal edges by approximating a vertical gradient. If you need to

emphasize vertical edges, transpose the filter H: H'.

[1 1 1;0 0 0;-1 -1 -1].

8、'sobel'

Sobel horizontal edge-emphasizing filter

用于边缘提取,无参数

H = FSPECIAL('sobel') returns 3-by-3 filter that emphasizes

horizontal edges utilizing the smoothing effect by approximating a

vertical gradient. If you need to emphasize vertical edges, transpose

the filter H: H'.

[1 2 1;0 0 0;-1 -2 -1].

9、'unsharp'

unsharp contrast enhancement filter

为对比度增强滤波器。参数alpha用于控制滤波器的形状,范围为【0,1】,默认值为0.2.

H = FSPECIAL('unsharp',ALPHA) returns a 3-by-3 unsharp contrast

enhancement filter. FSPECIAL creates the unsharp filter from the

negative of the Laplacian filter with parameter ALPHA. ALPHA controls

the shape of the Laplacian and must be in the range 0.0 to 1.0.

The default ALPHA is 0.2.

H = fspecial('motion',LEN,THETA) returns a filter to approximate, once

convolved with an image, the linear motion of a camera by LEN pixels,

with an angle of THETA degrees in a counter-clockwise direction. The

filter becomes a vector for horizontal and vertical motions.  The

default LEN is 9, the default THETA is 0, which corresponds to a

horizontal motion of 9 pixels.

H = fspecial('prewitt') returns 3-by-3 filter that emphasizes

horizontal edges by approximating a vertical gradient. If you need to

emphasize vertical edges, transpose the filter H: H'.

[1 1 1;0 0 0;-1 -1 -1].

H = fspecial('sobel') returns 3-by-3 filter that emphasizes

horizontal edges utilizing the smoothing effect by approximating a

vertical gradient. If you need to emphasize vertical edges, transpose

the filter H: H'.

[1 2 1;0 0 0;-1 -2 -1].

Class Support

-------------

H is of class double.

2

Example

-------

I = imread('cameraman.tif');

subplot(2,2,1);imshow(I);title('Original Image');

H = fspecial('motion',20,45);

MotionBlur = imfilter(I,H,'replicate');

subplot(2,2,2);imshow(MotionBlur);title('Motion Blurred Image');

H = fspecial('disk',10);

blurred = imfilter(I,H,'replicate');

subplot(2,2,3);imshow(blurred);title('Blurred Image');

标签:HSIZE,示例,default,fspecial,filter,returns,Matlab,horizontal

来源: https://blog.csdn.net/JimmyGoong/article/details/94717689

matlab fspecial disk,Matlab fspecial 用法详述,附示例相关推荐

  1. php eof 使用函数_PHP中EOF的用法介绍(附示例)

    本篇文章给大家带来的内容是关于PHP中EOF的用法介绍(附示例),有一定的参考价值,有需要的朋友可以参考一下,希望对你有所帮助. PHP EOF(heredoc)是一种在命令行shell(如sh.cs ...

  2. html svg 背景图片,在CSS背景图片中使用svg的用法介绍(附示例)

    本篇文章给大家带来的内容是关于在CSS背景图片中使用svg的用法介绍(附示例),有一定的参考价值,有需要的朋友可以参考一下,希望对你有所帮助. 在CSS背景图片中使用SVG,可以使用css backg ...

  3. 数字图像处理实验(三)|图像增强{归一化直方图imhist(f)/numel(f)、直方图均衡化histeq、生成线性空间滤波fspecial、中值滤波medfilt2}(附matlab实验代码截图)

    文章目录 一.实验目的 二.实验原理 1. 基本亮度变换函数 2.直方图均衡化 3.空间域滤波 三.预备知识: 四.实验内容 1.灰度修正 2.直方图均衡化: 3.空间域滤波 4. 频域率滤波 五.思 ...

  4. matlab中fdyn,Matlab的用法总结

    1. 对序列进行洗牌 randperm() randperm()产生随机的序列 %if filepaths 是一个5*1的结构体,then cshuffle = randperm(length(fil ...

  5. matlab imfilter函数,Matlab中imfilter()函数的用法

    Matlab中imfilter()函数的用法 功能:对任意类型数组或多维图像进行滤波. 用法:B = imfilter(A,H) B = imfilter(A,H,option1,option2,.. ...

  6. matlab MinGW-w64 C/C++ Compiler 的配置(附百度云下载资源)

    转载自:https://blog.csdn.net/weixin_43710112/article/details/105797054 matlab MinGW-w64 C/C++ Compiler ...

  7. matlab车牌识别课程设计,matlab车牌识别课程设计报告模板(附源代码).doc

    您所在位置:网站首页 > 海量文档 &nbsp>&nbsp计算机&nbsp>&nbspmatlab matlab车牌识别课程设计报告模板(附源代码). ...

  8. matlab i型级联filter,Matlab中filter,conv,impz用法(最新整理)

    <Matlab中filter,conv,impz用法(最新整理)>由会员分享,可在线阅读,更多相关<Matlab中filter,conv,impz用法(最新整理)(5页珍藏版)> ...

  9. 基于matlab的车牌识别系统程序,基于matlab的车牌识别系统的设计(附程序).doc

    基于matlab的车牌识别系统的设计(附程序).doc 1车牌识别系统的设计1.摘要:汽车牌照自动识别系统是制约道路交通智能化的重要因素,包括车牌定位.字符分割和字符识别三个主要部分.本文首先确定车辆 ...

  10. matlab 万年历,matlab时钟万年历 matlab时钟万年历(附word说明文档): 程序主要 联合开发网 - pudn.com...

    matlab时钟万年历 所属分类:图形图像处理 开发工具:matlab 文件大小:54KB 下载次数:6 上传日期:2018-08-24 21:54:23 上 传 者:小小葡萄123 说明:  mat ...

最新文章

  1. 实验 8 数组2 ok
  2. java 特殊符号正则_java利用正则表达式处理特殊字符的方法实例
  3. WPF 仿QQ登录框翻转效果
  4. 定时备份mysql数据库压缩文件
  5. 第二代飞信机器人“小达”问世了
  6. Springboot+Spring-Security+JWT 实现用户登录和权限认证
  7. 《C++编程风格(修订版)》——3.2 继承作用域准则
  8. 17秋 软件工程 团队第三次作业 预则立他山之石
  9. 实战案例:探索星巴克的世界分布
  10. Exchange 2010 使用http访问 OWA
  11. ABB变频器维修,ABB变频器,ABB变频器配件FS300R12KE3/AGDR-61C 驱动模块APOW-01C 电源板AINP-01C 可控硅触发板
  12. Python_机器学习_常用科学计算库_第5章_Pandas
  13. python中利用字典加密字符串_Python列表,字典和字符串操作
  14. nginx域名反向代理
  15. java 取整符号_浅析java中的取整(/)和求余(%)
  16. weblogic的集群与配置--架构师第九天
  17. 蛋花花谈程序员年过四十该何去何从
  18. [2021-01-06] Reply received is ‘GSOutput file <trail_file> is not in any allowed output directories
  19. javascript闭包的理解
  20. java 格式化千位符 逗号隔开 附加货币单位

热门文章

  1. st语言和c语言一样,什么是ST语言,一文带你了解ST语言
  2. 【gp数据库】查询GP中某张表的分布键信息
  3. 架构经验:微商城生态解决方案
  4. 字节游戏测试开发面试题
  5. Linux消息队列讲解
  6. SQLmap简单的使用——新手教程解析
  7. 手机把网页保存为html,怎么保存整个网页
  8. win10 jFrameDesigner安装
  9. APP微信小程序测试一览表(常规用例)
  10. 5配置单臂路由器 VLAN 间路由