MATLAB 之 wavedec2函数详解

MATLAB 之 wavedec2函数详解wavedec2函数:1.功能:实现图像(即二维信号)的多层分解,多层,即多尺度.2.格式:[c,s]=wavedec2(X,N,’wname’)    [c,s]=wavedec2(X,N,Lo_D,Hi_D)(我不讨论它)3.参数说明:对图像X用wname小波基函数实现N层分解,这里的小波基函数应该根据实际情况选择,具体选择办法可以搜之或者hel

大家好,又见面了,我是你们的朋友全栈君。

wavedec2函数:

1.功能:实现图像(即二维信号)的多层分解,多层,即多尺度.

2.格式:[c,s]=wavedec2(X,N,’wname’)

     [c,s]=wavedec2(X,N,Lo_D,Hi_D)(我不讨论它)

3.参数说明:对图像X用wname小波基函数实现N层分解,

这里的小波基函数应该根据实际情况选择,具体选择办法可以搜之或者 help WFILTERS

.输出为c,s.

c为各层分解系数,s为各层分解系数长度,也就是大小.

4.c的结构:c=[A(N)|H(N)|V(N)|D(N)|H(N-1)|V(N-1)|D(N-1)|H(N-2)|V(N-2)|D(N-2)|…|H(1)|V(1)|D(1)]

可见,c是一个行向量,即:1*(size(X)),(e.g,X=256*256,then c大小为:1*(256*256)=1*65536)

A(N)代表第N层低频系数,H(N)|V(N)|D(N)代表第N层高频系数,分别是水平,垂直,对角高频,以此类推,到H(1)|V(1)|D(1).


每个向量是一个矩阵的每列转置的组合存储。原文:Each vector is the vector column-wise storage of a matrix. 这是你理解A(N) H(N) | V(N) | D(N) 的关键。

很多人对wavedec2和dwt2的输出差别不可理解,后者因为是单层分解,所以低频系数,水平、垂直、对角高频系数就直接以矩阵输出了,没有像wavedec2那样转换成行向量再输出,我想你应该不再迷惑了。MATLAB 之 wavedec2函数详解

那么S有什么用呢?

s的结构:是储存各层分解系数长度的,即第一行是A(N)的长度(其实是A(N)的原矩阵的行数和列数),

第二行是H(N)|V(N)|D(N)|的长度,

第三行是

H(N-1)|V(N-1)|D(N-1)的长度,

倒数第二行是H(1)|V(1)|D(1)长度,

最后一行是X的长度(大小)


到此为止,你可能要问C的输出为什么是行向量?

1、没有那一种语言能够动态输出参数的个数,更何况C语言写的Matlab

2、各级详细系数矩阵的大小(size)不一样,所以不能组合成一个大的矩阵输出。

因此,把结果作为行向量输出是最好,也是唯一的选择。


另:MATLAB HELP wavedec2 里面说得非常明白了,如下.

wavedec2

Multilevel 2-D wavelet decomposition Syntax [C,S] = wavedec2(X,N,’wname’)


[C,S] = wavedec2(X,N,Lo_D,Hi_D)


Description wavedec2 is a two-dimensional wavelet analysis function.

[C,S] = wavedec2(X,N,’wname’) returns the wavelet decomposition of the matrix X at level N, using the wavelet named in string ‘wname’ (see wfilters for more information).

Outputs are the decomposition vector C and the corresponding bookkeeping matrix S. N must be a strictly positive integer (see wmaxlev for more information).

Instead of giving the wavelet name, you can give the filters. For [C,S] = wavedec2(X,N,Lo_D,Hi_D), Lo_D is the decomposition low-pass filter and Hi_D is the decomposition high-pass filter.

Vector C is organized as C = [ A(N) | H(N) | V(N) | D(N) | … H(N-1) | V(N-1) | D(N-1) | … | H(1) | V(1) | D(1) ]. where A, H, V, D, are row vectors such that A = approximation coefficients H = horizontal detail coefficients V = vertical detail coefficients D = diagonal detail coefficients Each vector is the vector column-wise storage of a matrix.

Matrix S is such that S(1,:) = size of approximation coefficients(N) S(i,:) = size of detail coefficients(N-i+2) for i = 2, …N+1 and S(N+2,:) = size(X)

Examples% The current extension mode is zero-padding (see dwtmode).

% Load original image. 
load woman; 
% X contains the loaded image.

% Perform decomposition at level 2 
% of X using db1. 
[c,s] = wavedec2(X,2,’db1′);

% Decomposition structure organization. 
sizex = size(X)

sizex =
    256 256
sizec = size(c)

sizec =
    1 65536
    val_s = s

val_s =
    64 64 
    64 64 
    128 128 
    256 256


Algorithm For images, an algorithm similar to the one-dimensional case is possible for two-dimensional wavelets and scaling functions obtained from one-dimensional ones by tensor product. This kind of two-dimensional DWT leads to a decomposition of approximation coefficients at level j in four components: the approximation at level j+1, and the details in three orientations (horizontal, vertical, and diagonal). The following chart describes the basic decomposition step for images: So, for J=2, the two-dimensional wavelet tree has the form See Alsodwt, waveinfo, waverec2, wfilters, wmaxlev ReferencesDaubechies, I. (1992), Ten lectures on wavelets, CBMS-NSF conference series in applied mathematics. SIAM Ed. Mallat, S. (1989), “A theory for multiresolution signal decomposition: the wavelet representation,” IEEE Pattern Anal. and Machine Intell., vol. 11, no. 7, pp. 674-693. Meyer, Y. (1990), Ondelettes et opérateurs, Tome 1, Hermann Ed. (English translation: Wavelets and operators, Cambridge Univ. Press. 1993.

版权声明:本文内容由互联网用户自发贡献,该文观点仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请联系我们举报,一经查实,本站将立刻删除。

发布者:全栈程序员-站长,转载请注明出处:https://javaforall.net/149987.html原文链接:https://javaforall.net

(0)
上一篇 2022年6月17日 下午5:00
下一篇 2022年6月17日 下午5:00


相关推荐

  • intellij 激活码【最新永久激活】

    (intellij 激活码)最近有小伙伴私信我,问我这边有没有免费的intellijIdea的激活码,然后我将全栈君台教程分享给他了。激活成功之后他一直表示感谢,哈哈~IntelliJ2021最新激活注册码,破解教程可免费永久激活,亲测有效,下面是详细链接哦~https://javaforall.net/100143.html83…

    2022年3月27日
    106
  • python 内建模块_simulink常用模块

    python 内建模块_simulink常用模块Python常用内建模块datetime处理日期和时间的标准库。注意到datetime是模块,datetime模块还包含一个datetime类,通过fromdatetimeimportdatetime导入的才是datetime这个类。如果仅导入importdatetime,则必须引用全名datetime.datetime。datetime.now()返回当前日期和时间,其类型是…

    2025年7月10日
    4
  • 安卓数据转移到iphone很慢_iphone数据迁移中断怎么继续

    安卓数据转移到iphone很慢_iphone数据迁移中断怎么继续如果你刚刚从安卓手机换了新的iPhone或者其他iOS设备,可以按照下面的步骤将数据转移到新设备,实现“无缝”过渡。准备工作在安卓手机上下载安装“转移到iOS”应用,打开安卓设备上的WiFi,并将新iOS设备和安卓设备都插入电源。转移需要在iPhone激活并设置新iOS设备过程进行,如果你已经激活,需要进入“设置”>“通用”>“还原”,然后选择“抹掉所有内容和设…

    2026年1月18日
    8
  • appdev文件是什么_常用域名后缀ac

    appdev文件是什么_常用域名后缀ac本地开发环境.dev不正常,找到文章mark一下转自:https://segmentfault.com/q/1010000012339191转载于:https://www.cnblogs.com/chanAndy/p/8031550.html

    2022年10月4日
    5
  • treeTable实现排序

    treeTable实现排序/***TreeTable0.1-Client-sideTreeTableViewer!*@requiresjQueryv1.3**DuallicensedundertheMITandGPLlicenses:*http://www.opensource.org/licenses/mit-license.php…

    2022年5月11日
    37
  • 【初学者必备】c++快速入门经典详细教程(零基础小白也可以分分钟学会)

    【初学者必备】c++快速入门经典详细教程(零基础小白也可以分分钟学会)目录 1 名称空间 usingnamespa 的解释 2 cin 和 cout 输入输出 3 关于 c 的头文件 4 c 的变量声明 5 c 特有的 bool 变量 6 c 特有的 const 定义常量 7 c 里超好用的 string 类 1 名称空间 usingnamespa 的解释这句话是使 std 这个名称空间 namespace 的意思 因为有的时候不同 商定义的函数名称彼此之间可能会重复 为了避免冲突 就给所有的函数都封装在各 的名称空间 使 这个函数的时候就在 main 函数前 写明 了什

    2026年3月26日
    2

发表回复

您的邮箱地址不会被公开。 必填项已用 * 标注

关注全栈程序员社区公众号