MATLAB第四次作业详细内容

这篇博客详细介绍了MATLAB第四次作业的内容,涉及一个用于给图像添加噪声的M文件。文章讨论了M文件的选择,特别是Image Processing Toolbox中的图像噪声函数,包括其输入参数和功能。此外,还讲解了M文件的结构,如主函数、初始化、输入参数检查、数据类型转换以及噪声类型判断。最后,博主分享了从这个作业中获得的收获和存在的疑问。
摘要由CSDN通过智能技术生成

MATLAB第四次作业详细内容

第四次作业

1. M文件的选择

选择 Image Processing Toolbox中的 Imnoise函数——图像噪声函数. 以下为该函数的函数名, F1行以及函数说明行.

function b = imnoise(varargin) %varargin:表示输入参数列表(输入参数个数不定,可变)
    %IMNOISE Add noise to image.
    %   J = IMNOISE(I,TYPE,...) Add noise of a given TYPE to the intensity
    %   image I. TYPE is a string or char vector that can have one of these
    %   values:
    %
    %       'gaussian'       Gaussian white noise with constant
    %                        mean and variance (均值和方差)
    %
    %       'localvar'       Zero-mean Gaussian white noise
    %                        with an intensity-dependent variance
    %
    %       'poisson'        Poisson noise
    %
    %       'salt & pepper'  "On and Off" pixels
    %
    %       'speckle'        Multiplicative noise
    %
    %   Depending on TYPE, you can specify additional parameters to IMNOISE. All
    %   numerical parameters are normalized; they correspond to operations with
    %   images with intensities ranging from 0 to 1.
    %
    %   J = IMNOISE(I,'gaussian',M,V) adds Gaussian white noise of mean M and
    %   variance V to the image I. When unspecified, M and V default to 0 and
    %   0.01 respectively.
    %
    %   J = imnoise(I,'localvar',V) adds zero-mean, Gaussian white noise of
    %   local variance, V, to the image I.  V is an array of the same size as I.
    %
    %   J = imnoise(I,'localvar',IMAGE_INTENSITY,VAR) adds zero-mean, Gaussian
    %   noise to an image, I, where the local variance of the noise is a
    %   function of the image intensity values in I.  IMAGE_INTENSITY and VAR
    %   are vectors of the same size, and PLOT(IMAGE_INTENSITY,VAR) plots the
    %   functional relationship between noise variance and image intensity.
    %   IMAGE_INTENSITY must contain normalized intensity values ranging from 0
    %   to 1.
    %
    %   J = IMNOISE(I,'poisson') generates Poisson noise from the data instead
    %   of adding artificial noise to the data.  If I is double precision,
    %   then input pixel values are interpreted as means of Poisson
    %   distributions scaled up by 1e12.  For example, if an input pixel has
    %   the value 5.5e-12, then the corresponding output pixel will be
    %   generated from a Poisson distribution with mean of 5.5 and then scaled
    %   back down by 1e12.  If I is single precision, the scale factor used is
    %   1e6.  If I is uint8 or uint16, then input pixel values are used
    %   directly without scaling.  For example, if a pixel in a uint8 input
    %   has the value 10, then the corresponding output pixel will be
    %   generated from a Poisson distribution with mean 10.
    %
    %   J = IMNOISE(I,'salt & 
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值