matlab中appcoef2,2-D detail coefficients

This example shows how to extract detail coefficients from a discrete wavelet analysis of an image. This example uses zero-padding.

Set the extension mode to zero-padding. Load and display an image.

origmode = dwtmode('status','nodisplay');

dwtmode('zpd','nodisplay');

load woman

imagesc(X)

colormap(gray)

10602ec25040a4c2fb94f47feecd7ee6.png

Obtain the wavelet decomposition of the image down to level two using the Haar wavelet.

[c,s] = wavedec2(X,2,'haar');

size(X)

ans = 1×2

256 256

size(c)

ans = 1×2

1 65536

s

s = 4×2

64 64

64 64

128 128

256 256

Extract the detail coefficients at level 2 in each orientation from the wavelet decomposition structure [c,s]. Display the diagonal detail coefficients.

[chd2,cvd2,cdd2] = detcoef2('all',c,s,2);

size(cdd2)

ans = 1×2

64 64

imagesc(cdd2)

colormap(gray)

b66f2d78f4929bf8017f90521fa75460.png

Extract the detail coefficients at level 1 in each orientation. Display the vertical detail coefficients.

[chd1,cvd1,cdd1] = detcoef2('all',c,s,1);

size(cvd1)

ans = 1×2

128 128

imagesc(cvd1)

colormap(gray)

6abfd334887019a7a434e10ced1b160c.png

Restore the original extension mode.

dwtmode(origmode,'nodisplay')

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值